Question: Solve Example 6.2 on page 111 of textbook, using the 4 th order Runge Kutta method. I HAVE SEEN THE LONG CODE POSTED BY OTHER

Solve Example 6.2 on page 111 of textbook, using the 4th order Runge Kutta method.

I HAVE SEEN THE LONG CODE POSTED BY OTHER USERS, THAT IS NOT CORRECT. IT SHOULD BE A SHORTER CODE. PLEASE DO NOT ANSWER IF YOURE GOING TO COPY AND PASTE THE LONG CODE EVERYONE ELSE HAS POSTED ON HERE.

You can use the results from the code attached below (from the textbook by ODE45 solver) as a reference.

Solve Example 6.2 on page 111 of textbook, using the 4th order

Example 6.2 ode45 ex.m % This program solves a system of 3 differential equations % by using ode45 function clear; clc; initial=[0. O 1.0 1.0]; tspan 0.0:0.1:10.0 options-odeset ('RelTol',1.0e-6, 'AbsTol', [1.0e-6 1.0e-6 1.0e-6]) [t, Y] =ode45 (@dydt3, tspan, initial , options) ; disp (P) yl-P(,2); y2-P(,3) y3-P(,4); fid= fopen ( output. txt, , ,w, ) ; fprintf (fid, ' fprintf (fid,' for i=1:2:101 Y (2) y(3) In') fprintf (fid,, %6.2f %10.2f %10.2f 10.2 n', .. . end fclose (fid); plot (t1,Y(:,1),ti,y(:,2),' - .',tl,Y(:,3),'--'), xlabel('t'), ylabel ('Y(1),Y (2), Y(3)'),title ('Y vs. t') grid text (6.0, -1.2,,y(1),), text (7.7, -0.25,,y(2),), text (4.2,0.85, ,y(3),); % dydt3.m % functions for example problem function Yprime-dydt3 (t, Y) Yprime-zeros (3,1); Yprime (1)-Y (2) *Y (3) *t Yprime (2)Y(1) Y (3) Yprime (3)0.51*Y (1) *Y (2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!