Open
Conversation
Simple 1D Chaotic test problem that is significantly better understood than Lorenz '96
elswit
reviewed
Sep 7, 2020
elswit
reviewed
Sep 7, 2020
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))).').'; | |||
Member
There was a problem hiding this comment.
diag(k) can be replaced with .* to scale rows
| end | ||
|
|
||
| methods | ||
| function soly = solution2real(soly) |
Member
There was a problem hiding this comment.
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)); |
Member
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simple 1D Chaotic test problem that is significantly better understood than Lorenz '96