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

Added preconditioner based on Taylor expansion #158

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

Conversation

brownbaerchen
Copy link
Contributor

This is a preconditioner built in a similar way to the extrapolation based error estimate. I was just playing around with diagonal preconditioners and somehow arrived at this one, which is not at all diagonal, but it's higher order than one (kind of). At least I got a fourth order method with two sweeps in the Pi-line problem, but then fifth order with three sweeps.
Was this done before? Does any sort of analysis exist for this? Is it worth pursuing? I have no idea, I was just messing around a bit.

@pancetta
Copy link
Member

Please add a small example or a test of this new preconditioner. Looks interesting, but I'd like to see this at work (and so does my CI monster).

@tlunet
Copy link
Member

tlunet commented Aug 23, 2022

😭 seemed like a good idea ...

@brownbaerchen
Copy link
Contributor Author

Oh don't worry! I am quite eager to work on this, but it's gonna be a whole thing! I realised that I was constructing linear multistep methods as preconditioners and these are not necessarily stable. For the Piline equation, I could get really good results (fourth order local error in one sweep with three nodes) but for advection and heat equation, the schemes were unstable.
Now, I need to do one of two things (or both): Somehow construct stable LMMs or construct Runge-Kutta schemes instead.

I just decided to close this PR so you don't get an email every time I make a commit :)

@brownbaerchen brownbaerchen reopened this Aug 24, 2022
@brownbaerchen
Copy link
Contributor Author

So apparently there is a theorem that there are no A-stable LMMs with order higher than two, which makes these preconditioners somewhat useless... But they are convergent at least.

@tlunet
Copy link
Member

tlunet commented Aug 24, 2022

How does the second order preconditionner looks like ?

I've been messing a bit with high order sweeps during my PhD to increase explicit SDC stability, and found out that getting higher order was not helping much ... but I found an explicit second order sweep that was as expensive as Forward Euler in term of computation cost, and wasn't that bad at the end. But I never got to write it using the QDelta matrix formulation (that was waaaay too obscure for me at that time 😅)

@brownbaerchen
Copy link
Contributor Author

The first order LMM that is derived in this way is backward Euler and the second order LMM that is derived here is the trapezoidal rule, both of which are A-stable, so that is good.
In the PR there is a notebook where I plot the order for the Piling equation and at least in the first sweep I get quite high order. After that there may be some numerics that is keeping me from seeing the order, or the order is really just increased by one with each sweep, which would be weird.
But I am wondering why the trapezoidal rule is not popular with SDC...

Yes, the QDelta is confusing. I just don't think about it too much and just construct time marching schemes and plug them in there how I learned from other preconditioners. But why this works out is unclear to me, since you subtract in on the rhs. and have the full Q. But it looks like it's working.. :D

@brownbaerchen
Copy link
Contributor Author

We don't have to merge this in the master branch by the way. I will maybe look more into the regions of stability (which depend on the nodes that you are using, both kind and number) but this may not be useful enough to put it in the master..

@tlunet
Copy link
Member

tlunet commented Aug 24, 2022

Actually, I don't know if there is already a functionality in pySDC that automatically computes and plots the regions of stability for given nodes and QDelta ... that would quite useful to compare preconditionners

@brownbaerchen
Copy link
Contributor Author

My plan was to make script that executed dahlquist problems for some patch in the complex plane and shows if the scheme is stable. Do you think it's possible to do this analytically in an automated way? I haven't spend to many thoughts on this. I am guessing with the boundary locus method it must be possible somehow...

@tlunet
Copy link
Member

tlunet commented Aug 24, 2022

Don't know what the boundary locus method is ...

The way I imagine it : you discretize the complex plane into lam_{i,j} = x_i + y_j i, then put all those lam_{i,j} values in a diagonal matrix A, then use SDC to solve dU/dt = AU with u_0 = 1, on one time step delta_t = 1, to get a numerical solution u_{i,j} for each lam_{i,j}. Then you look at the absolute values of u_{i,j} and plot it in the complex plane. Unitary isocontours represent the stability contour, and regions with |u_{i,j}| <= 1 the numerically stable regions.

Here are some examples of stability contours I got with this approach ... using FE sweep

grafik

and trying some explicit multi-steps preconditionners (SO = second order, TO = third order)

grafik

PS : and I forgot, but the stability regions also depend on the number of iterations ... ;)

@brownbaerchen
Copy link
Contributor Author

Ok that was what I was about to do, so that's good! The many-tests-simulateneously Dahlquist equation is already implemented in pySDC.

I saw that the stability region depends on the number of iterations in my tests, but I thought that was some bogus numerics... Even if nothing comes of this project, I have definitely learned a lot already, and will learn lots more, so it wasn't a waste of time ;)

@brownbaerchen
Copy link
Contributor Author

@danielru
Copy link
Member

So apparently there is a theorem that there are no A-stable LMMs with order higher than two, which makes these preconditioners somewhat useless... But they are convergent at least.

This is correct but there are A(alpha)-stable LMMs of order more than two. So unless you are targeting stiff oscillatory problems like we did in the FWSW-SDC paper, you might get away with A(alpha) stable methods.

@brownbaerchen
Copy link
Contributor Author

So apparently there is a theorem that there are no A-stable LMMs with order higher than two, which makes these preconditioners somewhat useless... But they are convergent at least.

This is correct but there are A(alpha)-stable LMMs of order more than two. So unless you are targeting stiff oscillatory problems like we did in the FWSW-SDC paper, you might get away with A(alpha) stable methods.

Do you know how to construct particularly stable LMMs? So far I did not come up with something better than trial and error..

@tlunet
Copy link
Member

tlunet commented Jan 9, 2023

@tlunet tlunet closed this Jan 9, 2023
@tlunet tlunet reopened this Jan 9, 2023
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.

4 participants