Hi All, Just wanted to check to see if I am doing this correctly If the equation is Where m = 1.5 c =190, k=28, F(t) = -500sin(10t) I know that it has to be in the form of So solving Eulers method to 0.2 with a step size of 0.1 Now to change into for f(x,y) I have done the following Is this the correct equation for f(x,y)?? So for i = 0 where x0 = 0 y0 = 0 h = 0.1 This is where I think I have made a mistake becuase the two answers that I have found are very different from one another. I would like to know if I have done this correclty. and for i = 1
These are the answer that I have found for the step increase of 0.1 to 0.5 Can anyone confirm is these are correct please
I'm not sure if your approach is correct. Normally one applies Euler's method to a first order differential equation - or in the case of an Nth order DE to a set of N individual 1st order DE's formulated as an 'equivalent' of the original Nth order equation. In the case of a 2nd order DE you need 2 equations to perform the Euler numerical approximation. So you have One follows a process like this .... Let Hence Then form two first order Euler approximations with step h[sec] and Then proceed with successive approximations given I also think h=0.1 is too big a step size.
I am not sure if I understand this correctly but here what I have done and So i = 0, h=0.1, x=0,y=0,z=0 So the equation is so and zi = 0 Now what I have found which make me think that I am incorrect is that when I find i = 1 , x,y,z all = 0 still.
The value of h is not incremented with successive steps - it stays the same. Also, I indicated that a step of h=0.1 [seconds] is too big to obtain a useful solution. This is based on a consideration of the incremental change in the forcing function F(t). Presumably you want to find the value of y(t) at t=0.2 seconds. It would be good practice to do at least 10 steps from t=0 to 0.2 seconds. If you made a step size of h=0.02 seconds then going from t=0 to 0.2 seconds would involve 10 steps. Even then the approximation will be somewhat rough. One hundred steps would be better still. Doing it in just two steps is of little practical use. I realise doing even tens of steps with pen and paper would be laborious and error prone. I would think it would be best done using a computer based simulation. It can be readily done using a spreadsheet application - Excel for example.
Ok I see where I have gone wrong with the step sizes. but still if I use the small step sizes then I end up with z = 0 and y=0, for i=0 and then when I go to i=1 the values for the equation are x,y,z =0 which again will give zero. and So i = 0, h=0.02, x=0,y=0,z=0 So the equation is so and zi = 0 so if I was to continue then the values are i = 1, x = 0,y=0,z=0 from above. I have missed something simple
You still haven't got the method quite right. y(0)=0, z(0)=0, h=0.02 f1(t,y,z)=-333.33*sin(10*t)-126.67*z-18.67*y or f1(t,y,z)=-(333.33*sin(10*t)+126.67*z+18.67*y) f2(t,y,z)=z y(0.02)=y(0)+f2(0,0,0)*h=0+0*0.02=0 z(0.02)=z(0)-(333.33*sin(10*0)+126.67*0+18.67*0)*0.02=0 y(0.04)=y(0.02)+f2(0.02,0,0)=0 z(0.04)=y(0.02)-(333.33*sin(10*0.02)+126.67*0+18.67*0)*0.02 or z(0.04)=0-333.33*sin(0.2)*0.02=-1.324 y(0.06)=y(0.04)+z(0.04)*0.02=0-1.324*0.02=-0.02648 z(0.06)=z(0.04)-(333.33*sin(10*0.04)+126.67*(-1.324)+18.67*0)*0.02 or z(0.06)=-1.324-(129.8-167.7)*0.02=-0.566 and so on ...