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

Kuramoto Sivashinky 1D PDE #9

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Conversation

AndreyAPopov
Copy link
Member

Simple 1D Chaotic test problem that is significantly better understood than Lorenz '96

Simple 1D Chaotic test problem that is significantly better understood than Lorenz '96
Note: the jacobian is dense for all non-trivial inputs. for the initial condition it might seem like the jacobian is sparse, but this is a red herring. The jacobian is dense, and the way in which it is computed in this code is as efficient as I dare make it.
@@ -0,0 +1,5 @@
function j = jac(~, u, k, k2, k4)

j = -diag(k2) - diag(k4) - diag(k)*ifft(fft(diag(ifft(u))).').';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diag(k) can be replaced with .* to scale rows

end

methods
function soly = solution2real(soly)
Copy link
Member

@Steven-Roberts Steven-Roberts Jul 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with Pendulum problem, let's rename to something like convert2grid and not bother supporting solution struct.

% right boundary point
x = linspace(h, L, N).';

u0 = cos(x/16).*(1+sin(x/16));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace hardcoded 16 so i.c. is periodic for different L. It might be easier to have x in the range 0 to 2 pi.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I have x in 0 to 2 pi, then I would have to calculate h differently. I will change u0, to be a function of L and use cospi and sinpi. I think that is simpler.

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

Successfully merging this pull request may close these issues.

3 participants