Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

matlab code here are some better pictures EXERCIN You will send to end there the of your MATLAB MATLAB MATLAB SISWB there web SLATLAB .

matlab code image text in transcribed
image text in transcribed
here are some better pictures image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
EXERCIN You will send to end there the of your MATLAB MATLAB MATLAB SISWB there web SLATLAB . Cartile to put Only a single die beid Chatearow we fee with the who Take compte the t epl .. . ). ROTECTED AND MAY NOT BE SHARED, UPLOADED SOLD OR DISTRIBUTED The goal of this exercise is to write a script file to plot the solutions to the differential equation in the interval O SIS7, with initial conditions y(0) 360, 600, 900. The script file should have the structure script function (similarly to the M-file syplot2.. Example 2, page 5). Call the file ex5.m. The function that defines y() must be included in the same file (note that the function defining y(x) will have two input arguments and C). Your M-file should have the following structure (fill in all the ?? with the appropriate com mands): x- ??; % define the vector in the interval [0.7] y1 - 1 (??); % compute the solution with C-360 y2 - (??); % compute the solution with C - 600 y3 - f (??); % compute the solution with C - 900 plot (??) % plot the three solutions with different line-styles title (??) % add a title legend (??) % add a legend function y = f(x,c) y - ??% fill-in with the expression for the general solution end Plot the graphs in the same window and use different color and/or line-styles for each graph. To plot the graphs in the same window you can use the command hold on or use the plot command similarly to Exercise 4. Add the title 'Solutions to dy/dx13x + 13.2-1 cos(x). Add a legend with the list of C values used for each graph. (Type help plot for a list of the different line-styles, and help legend for help on how to add a legend.) Include both the M-file and the plot in your report. NOTE: the only output of the script file should be the graph of the three curves. Make sure you use enough points so that the curves are nice and smooth cos(5 ) 6. (a) Enter the function g(,y) + 2 2 - as an anonymous function (see pages 6 and 7). Evaluate the function at 1 -7 and y 3 by entering g(-7, 3) in the command window. (b) Type clear g to clear the value of the function from part (a). Now write a function M-file for the function g(x,y) - 1 . Save the file as g. (include the M-file in your report). Evaluate the function at I= -7 and y = 3 by entering g(-7,3) in the command window. Exercises Instructions: You will need to record the results of your MATLAB session to generate your lab report. It is recommended you use the "Publish feature" in MATLAB to generate your lab report. A template for this lab will be provided. Alternatively, you can copy and paste all your computations from MATLAB to your favorite text editor (e.g. MS Word). Before you submit your report, you will need to edit it: Remove all typing errors. Unless otherwise specified, your write-up should contain the MATLAB input commands the corresponding output, and the answers to the questions that you have written. If the exercise asks you to write an M-file, copy and paste the file into your lab write-up in the appropriate position (after the problem number and before the output generated by the file). THIS CONTENT IS PROTECTED AND MAY NOT BE SHARED, UPLOADED, SOLD OR DISTRIBUTED 2019 v16 Copricht School of Mathematical and Statistical Science, Arna State University El - If the exercise asks for a graph, copy the figure and paste it into your lab write-up in the ap- propriate position. Crop and resize the figure so that it does not take too much space. Use "" to suppress the output from the vectors used to generate the graph. Make sure you use enough points for your graphs so that the resulting curves are nice and smooth Clearly separate all exercises. The exercises' numbers should be in a larger format and in boldface. Preview the document before printing and remove unnecessary page breaks and blank spaces. Include your name and course number, labi (3).pdf lab1 (4).pdf If the exercise asks for a graph, copy the figure and paste it into your lab write-up in the ap- p and resize the figure so that it does not take too much space. Use " to suppress the output from the vectors used to generate the graph. Make sure you use enough points for your graphs so that the resulting curves are nice and smooth. Clearly separate all exercises. The exercises' numbers should be in a larger format and in boldface. Preview the document before printing and remove unnecessary page breaks and blank spaces. Include your name and course number. Convert your file to pdf format. Only a single pdf file should be submitted! 1. All points with coordinates arcos() and y rsin(0), where r is a constant, lie on a circle with radius r, i.e. satisfy the equation 2? + y2 -2. Create a row vector for 0 with the values @ 0,5... . and 7 Taker-7 and compute the row vectors r and y. Now check that I and y indeed satisfy the equation of a circle, by computing the radius r= ? + Hint: To calculater you will need the array operator for squaring and y. Of course, you could also computer by x.*x. 2. Use the linspace command or the colon operator to create a vector t with entries e cos(21) 1,105,1.1,...,5, and define the function y = 0.142+1 (make sure you use ";" to sup- press the output for both t and y). (a) Plot the function y in black and include a title with the expression for (b) Make the same plot as in part (a), but rather than displaying the graph as a curve show the unconnected data points. To display the data points with small circles, se plot(t,y. 'O'). Now combine the two plots with the command plot(t.y.'o- to show the line through the data points as well as the distinct data points lab1 (4).pdf lab1 (3).pdf Downloads/lab1%20(5).pdf could also compute r by x.*x. 2. Use the linspace command or the colon operator : to create a vector t with entries els cos(21) 1,1.05, 1.1,...,5, and define the function y = (make sure you use ";" to sup- 0.1/2 + 4 press the output for both t and y). (a) Plot the function y in black and include a title with the expression for y. (b) Make the same plot as in part (a), but rather than displaying the graph as a curve, show the unconnected data points. To display the data points with small circles, use plot(t,y,'o'). Now combine the two plots with the command plot(t,y,'o' to show the line through the data points as well as the distinct data points. 3. Use the command plot3(x,y,z) to plot the circular helix 1 9.cos(34), y = 9 sin(3t), 2 = 61, OSIS 15. Add a grid to the plot using the command grid on. NOTE: Use semicolon to suppress the output when you define the vectors and . Make sure you use enough points for your graph so that the resulting curve is nice and smooth 4. Plot y sin(3.c) in red with a solid line and the Taylor polynomial approximation 2 3. - r in blue with a dashed line for - Srs on the same plot. Hint: Use plot(x,y. 'r'.x,2,'--'). Add a grid to the plot using the command grid on Type axis tight to set the axis limits to the range of the data. NOTE: Use semicolon to suppress the output when you define the vectors x, y and . Make sure you use enough points for your graph so that the resulting curves are nice and smooth 5. The general solution to the differential equation =13.7 + 13.r? - 1 cos(x) is 3(z) - 132 133 - 1 sin(x) +C with y(0) = C. THIS CONTENT PROTECTED AND MAY NOT BE SHARED, UPLOADED SOLD OR DISTRIBUTED The goal of this exercise is to write a script file to plot the solutions to the differential equation in the interval 0

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

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions

Question

1. Make sure you can defend the grade in the first place.

Answered: 1 week ago