Home / Expert Answers / Computer Science / implement-a-fourth-order-runge-kutta-method-that-integrates-the-system-y-f-y-from-t-0-to-t-10-pa365

(Solved): Implement a fourth-order Runge-Kutta method that integrates the system y^()=f(y) from t=0 to t=10 ...



Implement a fourth-order Runge-Kutta method that integrates the system

y^(˙)=f(y)

from

t=0

to

t=100

with stepsize

h=0.05

. Use the four initial conditions described in the table below. You can use the pendplot function to animate the motion of the pendulum, which might be fun and might help you debug your code. But you do not need to include these plots in your report. For each case, plot the function

\theta _(2)(t)

versus time. Cases 3 and 4 demonstrate the initial value sensitivity of the system, namely, that a small perturbation can lead to drastically different solutions. Your report should contain the MATLAB commands required to produce the results, and the four plots of

\theta _(2)(t)

. Run Case 1 in problem

,

with the five stepsizes

h=(0.05)/(2^((k-1))),k=1,2,3,4

, and

h=0.001

. Compute the value of

\theta _(2)(t=100)

for each stepsize. Consider the last result the exact solution, and plot the four errors as a function of

h

in a loglog-plot. Estimate the order of convergence from the slope. Your report should contain the MATLAB commands used, the five values of

\theta _(2)(t=100)

, the loglog-plot, and the estimated slope.



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe