Problem:
Derive the Adams-Moulton scheme and Adams-Bashforth scheme that uses yn+1,yn,fn−1 and yn,fn−1,fn−2 respectively.
Solution:
To approximate a polynomial with three points, we use the Lagrange's polynomial.
p(t)=fn(t−(n−1)Δt)(t−(n−2)Δt)(nΔt−(n−1)Δt)(nΔt−(n−2)Δt)+fn−1(t−nΔt)(t−(n−2)Δt)((n−1)Δt−nΔt)((n−1)Δt−(n−2)Δt)+fn−2(t−nΔt)(t−(n−1)Δt)((n−2)Δt−nΔt)((n−2)Δt−(n−1)Δt)=fn(t−(n−1)Δt)(t−(n−2)Δt)2Δt2+fn−1(t−nΔt)(t−(n−2)Δt)−Δt2+fn−2(t−nΔt)(t−(n−1)Δt)2Δt2=12Δt2(fn(t−(n−1)Δt)(t−(n−2)Δt)−2fn−1(t−nΔt)(t−(n−2)Δt)+fn−2(t−nΔt)(t−(n−1)Δt))
Note that while the expression is long, it is simply a quadratic polynomial with a lot of awful looking constants. To simplify things, let u=t−nΔt
p(u)=12Δt2(fn(u+Δt)(u+2Δt)−2fn−1(u)(u+2Δt)+fn−2(u)(u+Δt))=12Δt2(fn(u2+3uΔt+2Δt2)−2fn−1(u2+2uΔt)+fn−2(u2+uΔt))=12Δt2(u2(fn−2fn−1+fn−2)+uΔt(3fn−4fn−1+fn−2)+2fnΔt2)
Ugly as is, we can integrate now.
yn+1−yn=tn+1∫tnf(t,y)dtyn+1=yn+tn+1∫tnf(t,y)dt≈yn+tn+1∫tnp(t)dt≈yn+Δt∫0p(u)du≈yn+Δt∫012Δt2(u2(fn−2fn−1+fn−2)+uΔt(3fn−4fn−1+fn−2)+2fnΔt2)du≈yn+12Δt2Δt∫0(u2(fn−2fn−1+fn−2)+uΔt(3fn−4fn−1+fn−2)+2fnΔt2)du≈yn+12Δt2(u33(fn−2fn−1+fn−2)+u22Δt(3fn−4fn−1+fn−2)+2ufnΔt2)|Δt0≈yn+12Δt2(Δt33(fn−2fn−1+fn−2)+Δt32(3fn−4fn−1+fn−2)+2Δt3fn)≈yn+Δt2(13(fn−2fn−1+fn−2)+12(3fn−4fn−1+fn−2)+2fn)≈yn+Δt12(2(fn−2fn−1+fn−2)+3(3fn−4fn−1+fn−2)+12fn)≈yn+Δt12(23fn−16fn−1+5fn−2)
This is the Adam-Bashforth scheme - I will skip the Adam Moulton scheme, derivation like this is best leave to the computer...
We have the correct answer at https://en.wikipedia.org/wiki/Linear_multistep_method, and it is great to see the answer matches (to be honest to my future self, I did spend great time to fix the derivation to match the solution, the very detailed derivation does help me a lot to fix the bug without redoing everything)
Derive the Adams-Moulton scheme and Adams-Bashforth scheme that uses yn+1,yn,fn−1 and yn,fn−1,fn−2 respectively.
Solution:
To approximate a polynomial with three points, we use the Lagrange's polynomial.
p(t)=fn(t−(n−1)Δt)(t−(n−2)Δt)(nΔt−(n−1)Δt)(nΔt−(n−2)Δt)+fn−1(t−nΔt)(t−(n−2)Δt)((n−1)Δt−nΔt)((n−1)Δt−(n−2)Δt)+fn−2(t−nΔt)(t−(n−1)Δt)((n−2)Δt−nΔt)((n−2)Δt−(n−1)Δt)=fn(t−(n−1)Δt)(t−(n−2)Δt)2Δt2+fn−1(t−nΔt)(t−(n−2)Δt)−Δt2+fn−2(t−nΔt)(t−(n−1)Δt)2Δt2=12Δt2(fn(t−(n−1)Δt)(t−(n−2)Δt)−2fn−1(t−nΔt)(t−(n−2)Δt)+fn−2(t−nΔt)(t−(n−1)Δt))
Note that while the expression is long, it is simply a quadratic polynomial with a lot of awful looking constants. To simplify things, let u=t−nΔt
p(u)=12Δt2(fn(u+Δt)(u+2Δt)−2fn−1(u)(u+2Δt)+fn−2(u)(u+Δt))=12Δt2(fn(u2+3uΔt+2Δt2)−2fn−1(u2+2uΔt)+fn−2(u2+uΔt))=12Δt2(u2(fn−2fn−1+fn−2)+uΔt(3fn−4fn−1+fn−2)+2fnΔt2)
Ugly as is, we can integrate now.
yn+1−yn=tn+1∫tnf(t,y)dtyn+1=yn+tn+1∫tnf(t,y)dt≈yn+tn+1∫tnp(t)dt≈yn+Δt∫0p(u)du≈yn+Δt∫012Δt2(u2(fn−2fn−1+fn−2)+uΔt(3fn−4fn−1+fn−2)+2fnΔt2)du≈yn+12Δt2Δt∫0(u2(fn−2fn−1+fn−2)+uΔt(3fn−4fn−1+fn−2)+2fnΔt2)du≈yn+12Δt2(u33(fn−2fn−1+fn−2)+u22Δt(3fn−4fn−1+fn−2)+2ufnΔt2)|Δt0≈yn+12Δt2(Δt33(fn−2fn−1+fn−2)+Δt32(3fn−4fn−1+fn−2)+2Δt3fn)≈yn+Δt2(13(fn−2fn−1+fn−2)+12(3fn−4fn−1+fn−2)+2fn)≈yn+Δt12(2(fn−2fn−1+fn−2)+3(3fn−4fn−1+fn−2)+12fn)≈yn+Δt12(23fn−16fn−1+5fn−2)
This is the Adam-Bashforth scheme - I will skip the Adam Moulton scheme, derivation like this is best leave to the computer...
We have the correct answer at https://en.wikipedia.org/wiki/Linear_multistep_method, and it is great to see the answer matches (to be honest to my future self, I did spend great time to fix the derivation to match the solution, the very detailed derivation does help me a lot to fix the bug without redoing everything)
No comments:
Post a Comment