Question: Problem 3 Consider the following ODE - IVP: d y d t = y ( - 2 - 5 y - y 2 ) +

Problem 3 Consider the following ODE-IVP:
dydt=y(-2-5y-y2)+0.5cos(t),y(0)=3,tin[0,5]
that represents a CSTR with a fluctuating feed stream and a second-order reaction.
a) Write a MATLAB program that solves this problem numerically using RK4. This function
should take as input the initial condition (t0,y0), stepsize h, and the final time tf, and
automatically generate a labeled plot of y(t). Test this function for h=0.01 and report your
results.
b) Write a function that applies linear stability analysis to determine the maximum stepsize
required for stability at the current time (t,y(t)). Using this function, determine the maximum
stepsize h** so that the system is stable at the first step.
c) Using your code from Part (a), write a program that generates two plots: (1) a plot of the
maximum stepsize versus t, and (2) a plot of the numerical solution y versus t for h=0.02,
h=h**, and h=h**+0.035(on a single plot). For full credit, don't forget to comment on
your findings.
Problem 3 Consider the following ODE - IVP: d y d

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 Programming Questions!