Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Comments

@dyanoo
Copy link

dyanoo commented Apr 18, 2023

No description provided.

@sifanexisted
Copy link
Collaborator

sifanexisted commented Apr 18, 2023

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);

end

@dyanoo
Copy link
Author

dyanoo commented Apr 23, 2023

thanks you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants