Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB Project y = y + 2*cos(x) with initial condition y(0) = -2 1. Solve it analytically using dsolve and get its particular solution y(x).

MATLAB Project

image text in transcribed

y = y + 2*cos(x) with initial condition y(0) = -2 1. Solve it analytically using "dsolve" and get its particular solution y(x). 2. Create a set of x1-values between 0 and 2, e.g. by using x1 = 0:0.01:2; or by using linspace. Then use the analytic solution to get the corresponding y1-values. 3. Run euler_app.m (in Lab 3) with a poor resolution, use n=10 subdivisions only. This program prints in the output 10 pairs of x and y values. Put all the x-values in an array called x2 and the y-values in an array called y2. You do that by copying the numbers and pasting them into these array 4. Plot x1 vs. y1 as a continuous blue line. On the same graph, punch the 10 numerical points but paint them a different color, e.g. red. An example of how this is done is shown in the help pages of Matlab. The function that does this has the form: plot (x1, y1,...,x2,2,...) 5. Name the axes of the graph as x and y. Also use the command "title" to print the analytic particular solution at the top of the graph, as well as your names. Save your graph as a PDF file (Matlab can do that, if you click "Save As") and email it to me (dmc111@yahoo.com) by Saturday the 22nd of Feb at midnight. y = y + 2*cos(x) with initial condition y(0) = -2 1. Solve it analytically using "dsolve" and get its particular solution y(x). 2. Create a set of x1-values between 0 and 2, e.g. by using x1 = 0:0.01:2; or by using linspace. Then use the analytic solution to get the corresponding y1-values. 3. Run euler_app.m (in Lab 3) with a poor resolution, use n=10 subdivisions only. This program prints in the output 10 pairs of x and y values. Put all the x-values in an array called x2 and the y-values in an array called y2. You do that by copying the numbers and pasting them into these array 4. Plot x1 vs. y1 as a continuous blue line. On the same graph, punch the 10 numerical points but paint them a different color, e.g. red. An example of how this is done is shown in the help pages of Matlab. The function that does this has the form: plot (x1, y1,...,x2,2,...) 5. Name the axes of the graph as x and y. Also use the command "title" to print the analytic particular solution at the top of the graph, as well as your names. Save your graph as a PDF file (Matlab can do that, if you click "Save As") and email it to me (dmc111@yahoo.com) by Saturday the 22nd of Feb at midnight

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions