|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: numerical solution of differential equations
Quote:
Quote:
![]() |
|
#2
|
||||
|
||||
|
Re: numerical solution of differential equations
I've attached your spreadsheets modified for 1/4*x^3 + 1.
It seems that the Euler method does approximate it better. |
|
#3
|
||||
|
||||
|
Re: numerical solution of differential equations
@Mark: Where did you get the accel formula for columns D and G. |
|
#4
|
||||
|
||||
|
Re: numerical solution of differential equations
Not sure. Must have been really tired
. I did that over, and also added an error column to show the difference between Xa and the predicted X (Xm or Xe).I set dt = 0.01 s and compared the errors at t = 1, 2, 4 s For 1s: Midpt error: 0.598 Euler error: 0.585 For 2s: Midpt error: 2.834 Euler error: 2.748 For 4s: Midpt error: 50.070 Euler error: 48.113 Seems that, at least for this function, the Euler method holds up better. Tomorrow, I'll try it with a function where the second derivative isn't always positive on the interval I'm testing. |
|
#5
|
||||
|
||||
|
Re: numerical solution of differential equations
And the new sheets:
|
|
#6
|
||||
|
||||
|
Re: numerical solution of differential equations
where did you get the revised accel formula?
|
|
#7
|
||||
|
||||
|
Re: numerical solution of differential equations
I took the derivative of the actual velocity function. Is this not correct?
|
|
#8
|
|||||
|
|||||
|
Re: numerical solution of differential equations
No, as I read it you're setting x''=3x/2. This would be solved by a function of the form x=Ae3x/2
|
|
#9
|
||||
|
||||
|
Re: numerical solution of differential equations
Could you explain what this means? I'm not sure I understand...
|
|
#10
|
||||
|
||||
|
Re: numerical solution of differential equations
Quote:
I am assuming what you actually meant by that is x(t) = 1/4*t^3 + 1 Is that correct? If so, then in order to investigate the performance of Euler vs Midpoint numerical solution (in the context of this thread) you need to convert that to an initial value problem (IVP) consisting of a differential equation (involving only x, x', and x'') plus initial values for x(t) and x'(t) at some point t=to. Last edited by Ether : 12-24-2016 at 05:39 PM. |
|
#11
|
||||
|
||||
|
Re: numerical solution of differential equations
Yes, sorry about that. That was what I meant.
|
|
#12
|
||||
|
||||
|
Re: numerical solution of differential equations
OK.
x(t) = 1/4*t^3 + 1 is the analytical solution to the Initial Value Problem a(t) = sqrt(3*v(t)) with initial values* x(0.01) = 1.00000025 and v(0.01) = 7.5e-5 As you can see from the spreadsheet, the Midpoint method gives much better results for that IVP than Forward Euler and Forward/Backward Euler. * selected to avoid the stationary point at t=0 |
|
#13
|
||||
|
||||
|
Re: numerical solution of differential equations
Quote:
Quote:
given: x(t) = 1/4*t^3 + 1 ... take time derivative of x(t) to get: x'(t) = (3/4)*t^2 ...take time derivative of x'(t) to get: x''(t) = (3/2)*t Now solve for the differential equation: solve x'(t) for t: x'(t) = (3/4)*t^2 => t=sqrt(4x'(t)/3) ... and then substitute for t in x''(t): x''(t) = (3/2)*t = (3/2)*sqrt(4x'(t)/3) = sqrt(3*x'(t)) Last edited by Ether : 12-25-2016 at 08:11 AM. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|