Find an approximation for the solution of the initial value
Find an approximation for the solution of the initial value problem
x\'\'+tx\'+x^3=0, x(0)=0, x\'(0)=1 on the interval [0;2] with the step h=0.4.
 
PLEASE SHOW YOUR WORK ^^
x\'\'+tx\'+x^3=0, x(0)=0, x\'(0)=1 on the interval [0;2] with the step h=0.4.
PLEASE SHOW YOUR WORK ^^
Solution
Find an approximation for the solution of the initial value problem x\'\'+tx\'+x^3=0, x(0)=0, x\'(0)=1 on the interval [0;2] with the step h=0.4. x\'\'+tx\'+x^3=0 x\' = y ==> x\'\' = y\' x\'\'+tx\'+x^3=0 ==> y\' + t y + x^3=0 => y\' =-t y - x^3 Thus second order ODE reduces to linear system of ODE x\' = y, x(0) =0 y\' =-t y - x^3, y(0) = x\'(0) =1 Euler\'s method x_{n+1} = x_{n} + h y_{n}, x_{0}=0 y_{n+1} = y_{n} + h( - t_{n} y_{n} - (x_{n})^3 ), y_{0} =1 %% % euler rule clear euler h=0.4 ; tmin=0; tmax=2; n= (tmax -tmin)/h; t(1)= 0; x(1) =0; y(1)=1; disp(\' t x y \') disp(\'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\') for i=1:(n+1 ) t(i+1) = t(1)+ i*h; x(i+1) = x(i) + h* y(i); y(i+1) = y(i) + h*(-t(i)*y(i) - (x(i))^3); fprintf(\'%5.2f%17.7f%19.7f\ \', t(i), x(i), y(i) ); end eul1agus t x y ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0.00 0.0000000 1.0000000 0.40 0.4000000 1.0000000 0.80 0.8000000 0.8144000 1.20 1.1257600 0.3489920 1.60 1.2653568 -0.3892104 2.00 1.1096726 -0.9505150![Find an approximation for the solution of the initial value problem x\'\'+tx\'+x^3=0, x(0)=0, x\'(0)=1 on the interval [0;2] with the step h=0.4. PLEASE SHOW YO Find an approximation for the solution of the initial value problem x\'\'+tx\'+x^3=0, x(0)=0, x\'(0)=1 on the interval [0;2] with the step h=0.4. PLEASE SHOW YO](/WebImages/46/find-an-approximation-for-the-solution-of-the-initial-value-1146053-1761615961-0.webp)
