Problem:
Using a Taylor expansion for y(t+Δt)=yn+1 and y(t−Δt)=yn−1, derive an Euler-type formula for the future state of the system y′=f(y,t).
Solution:
The Taylor expansions are:
yn+1=y(t+Δt)=y(t)+Δtdydt(t)+Δt22d2ydt2(c1)=y(t)+Δtf(y,t)+Δt22d2ydt2(c1)
yn−1=y(t−Δt)=y(t)−Δtdydt(t)+Δt22d2ydt2(c2)=y(t)−Δtf(y,t)+Δt22d2ydt2(c2)
Now subtract the equations to get our answer
yn+1−yn−1=(y(t)+Δtf(y,t)+Δt22d2ydt2(c1))−(y(t)−Δtf(y,t)+Δt22d2ydt2(c2))=2Δtf(y,t)+Δt22(d2ydt2(c1)−d2ydt2(c2))yn+1=yn−1+2Δtf(y,t)+Δt22(d2ydt2(c1)−d2ydt2(c2))≈yn−1+2Δtf(y,t)
Using a Taylor expansion for y(t+Δt)=yn+1 and y(t−Δt)=yn−1, derive an Euler-type formula for the future state of the system y′=f(y,t).
Solution:
The Taylor expansions are:
yn+1=y(t+Δt)=y(t)+Δtdydt(t)+Δt22d2ydt2(c1)=y(t)+Δtf(y,t)+Δt22d2ydt2(c1)
yn−1=y(t−Δt)=y(t)−Δtdydt(t)+Δt22d2ydt2(c2)=y(t)−Δtf(y,t)+Δt22d2ydt2(c2)
Now subtract the equations to get our answer
yn+1−yn−1=(y(t)+Δtf(y,t)+Δt22d2ydt2(c1))−(y(t)−Δtf(y,t)+Δt22d2ydt2(c2))=2Δtf(y,t)+Δt22(d2ydt2(c1)−d2ydt2(c2))yn+1=yn−1+2Δtf(y,t)+Δt22(d2ydt2(c1)−d2ydt2(c2))≈yn−1+2Δtf(y,t)
No comments:
Post a Comment