#burger
def solve_burgers(X, t, nu):
def f(y):
return torch.exp(-torch.cos(np.pi * y) / (2 * np.pi * nu))
def g(y):
return np.exp(-(y**2) / (4 * nu * t))
def fun(eta):
return torch.sin(np.pi * (x - eta)) * f(x - eta) * g(eta)
def fun1(eta):
return f(x - eta) * g(eta)
U = np.zeros_like(X)
for i in range(len(X)):
x = X[[[i]]]
if np.abs(x) != 1:
uxt = -quad(fun, -np.inf, np.inf)[0] # Integrate using quad
U[i] = uxt / quad(fun1, -np.inf, np.inf)[0]
# print("uxt= ",uxt)
return U
Berger’s equation is solved according to the following article. I implemented this solution, but I think the answers are wrong, for example, at the moment t=0 25, the answers always start from 0 and have an increasing trend, which is not logical.I don’t know why the calculations are done correctly
I need your help in advance. thanks a lot.
paper: C. BASDEVANT, M. DEVILLE, P. HALDENWANG, J. M. LACROIX, J. OUAZZANI, R. PEYRET, P. ORLANDI,
A. T. PATERA, ‘’ SPECTRAL AND FINITE DIFFERENCE SOLUTIONS OF THE BURGERS EQUATION’’,
Nnnnnn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.