-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
Conversation
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.
src/+otp/+kuramotosivashinsky/jac.m
Outdated
@@ -0,0 +1,5 @@ | |||
function j = jac(~, u, k, k2, k4) | |||
|
|||
j = -diag(k2) - diag(k4) - diag(k)*ifft(fft(diag(ifft(u))).').'; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Simple 1D Chaotic test problem that is significantly better understood than Lorenz '96