You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to use the chebfun package to solve the Burgers equation? Is there any MATLAB code? I have been trying for a few days and have been experiencing problems
#1
Open
dyanoo opened this issue
Apr 18, 2023
· 2 comments
Thank you for reaching out to us. We mainly follow the matlab implemention from Fourier nerual operator paper. Please see https://github.com/neuraloperator/neuraloperator/tree/master/data_generation/burgers. But please note that we used different hyper-parameters to get the shock developed. Here we present a demo showing how we generate the dataset for the Burger's equation. The function GRF and Burgers are the same as in the shared link. Hope this may resolve your quesiton.
% number of realizations to generate
N = 1000;
% parameters for the Gaussian random field
gamma = 4;
tau = 5;
sigma = 25^(2);
% viscosity
visc = 0.0001;
% grid size
s = 4096;
steps = 200;
nn = 256;
inputs = zeros(N, nn);
if steps == 1
outputs = zeros(N, s);
else
outputs = zeros(N, steps, nn);
end
tspan = linspace(0,1,steps+1);
x = linspace(0,1, s+1);
X = linspace(0,1, nn);
for j=1:N
u0 = GRF(s/2, 0, gamma, tau, sigma, "periodic");
u = Burgers(u0, tspan, s, visc);
u0_eval = u0(X);
inputs(j,:) = u0_eval;
if steps == 1
outputs(j,:) = u.values;
else
for k=1:(steps+1)
outputs(j,k,:) = u{k}(X);
end
end
disp(j);
No description provided.
The text was updated successfully, but these errors were encountered: