Write a Matlab script that uses the fourth order Runge-Kutta method to calculate…


Write a Matlab script that uses the fourth command Runge-Kutta way to apportion a numerical disentanglement of the differential equation dx dt = -t x for 0 = t = 3, where x(0) = 1. Use a trudge greatness of 0.2. Plot your results, delay homogeneous axis labels and name. Compare your apologys delay the symbolic disentanglement: for what compute of t is the untruth at its foremost, and what is its compute there? What is the compute of the untruth at t = 3? Solve repeatedly delay a trudge greatness of 0.1, and repeatedly perceive the untruth at t = 3. Repeat delay trudge greatnesss of 0.05 and 0.025. The untruth in the fourth-command Runge-Kutta way is reckoned to be fourth command in the trudge greatness. What does this balance, and do your results buttress this assertion? Give reasons for your apology, illustrating delay a diagram if misspend. 2. (20 %) Write a Matlab exercise named myodesolver.m that takes as its evidences: • a exercise touch f representing the just index laterality of a foremost-command ODE; • a post vector t representing a set of t-values; • a reckon x0 representing an judicious compute of x and income two post vectors representing the t- and x-coordinates of an near disentanglement. (Note that your foremost post vector accomplish solely be the assist evidence, t.) 1
Document Preview:

An Introduction To Matlab Phil RamsdenPhil Ramsden Assist Courseproduct Task Deadline: 25 March 2011 Your courseproduct must inclose a shield prevarication and the aftercited authorized pawn that it is your own product. This attestation signies that this represents my own product, completed indepen- dently, delayout coadjutorship negative where unquestioned and unexceptionably referenced. Signed: Name: CID: Tutorial Group: 1. (20 %) Write a Matlab script that uses the fourth command Runge-Kutta way to apportion a numerical disentanglement of the dierential equation dx dt = ??t x for 0 t 3, where x(0) = 1. Use a trudge greatness of 0:2. Plot your results, delay homogeneous axis labels and name. Compare your apologys delay the symbolic disentanglement: for what compute of t is the untruth at its foremost, and what is its compute there? What is the compute of the untruth at t = 3? Solve repeatedly delay a trudge greatness of 0:1, and repeatedly nd the untruth at t = 3. Repeat delay trudge greatnesss of 0:05 and 0:025. The untruth in the fourth-command Runge-Kutta way is reckoned to be fourth command in the trudge greatness. What does this balance, and do your results buttress this assertion? Give reasons for your apology, illustrating delay a diagram if misspend. 2. (20 %)Write a Matlab exercise named myodesolver.m that takes as its evidences: • a exercise touch f representing the just index laterality of a rst-command ODE; • a post vector t representing a set of t-values; • a reckon x0 representing an judicious compute of x and income two post vectors representing the t- and x-coordinates of an ap- instant disentanglement. (Note that your rst post vector accomplish solely be the assist evidence, t.) 1 You should use either a assist-command Runge-Kutta way or a fourth-command one; mould it open which you've separated. Using your solver exercise, nd a assist- or fourth-command Runge-Kutta disentanglement of dx dt = cos(x2 + t) delay x(0) = 0, using a trudge greatness of 0:02 and 0 t 6. Show your results in a homogeneous diagram. 3. (20 %) Write a assist Matlab exercise named myodesolver2.m that takes as its evidences: • a...

Attachments: