Chat with us, powered by LiveChat Matlab.. tomorrow !! | Writedemy

Matlab.. tomorrow !!

Matlab.. tomorrow !!

MAE 215: Introduction to Programming in MATLAB Summer B 2016

Homework Assignment #3 Due: Tuesday, July 19th by 11.59 pm

Submission Instructions: Your solutions to this assignment must be typed and neatly presented. Unorganized solutions and/or solutions that do not present the required deliverables will not be graded and receive a score of zero. This assignment is to be submitted, in PDF format, to the assignment link on blackboard by the deadline. Students who obtain a score of 80% or greater on problem #3 will receive credit for outcome #2: students will Create MATLAB scripts and user-defined functions. 1. [10 pts] Revisiting MATLAB matrices and built-in functions.

a) Factor the following polynomials using MATLAB: i. π‘₯! + 18π‘₯ + 81 ii. π‘₯! + 11π‘₯ + 24 iii. π‘₯! βˆ’ 10π‘₯ + 9 iv. π‘₯! βˆ’ 4π‘₯! + 4π‘₯ βˆ’ 16 v. 2π‘₯! βˆ’ 16π‘₯ βˆ’ 40

b) Multiply the following vectors using β€œdot” multiplication. What does this type of operation do in contrast to traditional matrix multiplication? i. [5,6,9]’ with [10,10,10]’ ii. [1,1,1]’ with [2,5,1]’ iii. 𝐴 = 1 39 10 with 𝐡 =

4 5 10 2

2. [30 pts] Plotting in MATLAB.

a) Consider the following function: 𝑦 = 𝑓 π‘₯ = sin π‘₯ + π‘₯! + 6!

Create vectors from -10 to 10 with the following step-sizes: i. 5 ii. 1 iii. 0.1 iv. 0.001 v. 0.00001

plot the results on the same graph. Add axis labels, title and legend. b) Create multiple figures, plotting all data from part (a). Create new titles, as

necessary. Change the line styles to the following: i. red, black, green, cyan, magenta – grid on ii. black diamonds, red circles, blue x’s, dashed magenta, dotted green – grid off iii. black asterisks, red squares, dotted red, blue dashes, magenta squares – grid

on

MAE 215: Introduction to Programming in MATLAB Summer B 2016

Homework Assignment #3 Due: Tuesday, July 19th by 11.59 pm

c) Consider the following functions: 𝑦! = 6sin π‘₯! + cos 2π‘₯! 𝑦! = 12sin 2π‘₯! + cos 4π‘₯!

define x1 from 0 to 2πœ‹ with the following number of elements: i. 10 elements ii. 100 elements iii. 1000 elements iv. 10000 elements for each (i) – (iv) above, evaluate y1 and y2. Create a single figure window showing the progression of resolution as elements are added to x1. Each plot should have a legend, appropriate title and axis label and include the results from both y1 and y2. (hint: use subplots).

d) Consider the following two functions: 𝑓! π‘₯ = 3π‘₯! + 3π‘₯ + 87 𝑓! π‘₯ =

π‘₯ 2 + 3+ 64π‘₯

evaluate these functions from x = 0 to 100 in a step size that gives acceptable resolution (use your judgment!). Plot the results on the same figure. What is one problem with the figure generated? Find another MATLAB function that will fix this plotting issue and regenerate your plot. Add appropriate axis labels, legends, titles, etc.

e) Consider the data set given by the x and y vectors below: y = [ 3, 15, 26, 35, 41, 52, 60, 77, 84, 90, 95, 100]

x = [ 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60] Plot this data using a semi-log scale, creating a plot that has a natural logararithmic y-axis. (hint: semilogy()).

3. [40 pts] Working with MATLAB function files. a) Write a function file, that accepts values of x as inputs and outputs the value of y

when the input is passed through the following function: 𝑦 = 𝑒 !”!!!.!” + 4π‘₯ + 0.2π‘₯!

evaluate the function at a range of x values from 0 to 1 with 143 elements.

b) Consider the functions below, both of which are dependent on a single input, x. Create a function file that will return the value of both calculations when provided a value (or series of values) of x. Evaluate your functions for x values of 1,2,3 and 4 as well as the vector from 0 to 10 with 1000 elements. Plot your results, adding figure labeling, legends, etc. as necessary. You should present two plots, each with two lines.

𝑦! = π‘₯ + 5 𝑦! = 𝑒!! + sin (π‘₯)

MAE 215: Introduction to Programming in MATLAB Summer B 2016

Homework Assignment #3 Due: Tuesday, July 19th by 11.59 pm

c) Modify your function from 3(b) so that, after evaluating the value of y1 for a given

value of x, an intermediate calculation is performed which divides x by 10 before it is used in evaluating y2. Evaluate your function at the same points as 3(b) and compare the results.

d) Create a function file to evaluate the value of sin π‘₯ accurate to 9 Taylor series terms. Recall, the Taylor series for sin π‘₯ is given by:

sin π‘₯ β‰ˆ π‘₯ βˆ’ π‘₯!

3! + π‘₯!

5! βˆ’ π‘₯!

7! + π‘₯!

9! βˆ’ π‘₯!!

11! + π‘₯!”

13! βˆ’ π‘₯!”

15! + π‘₯!”

17! * NOTE: There are multiple ways to do this problem. Think it through before you code! Evaluate your function at various points on the domain [0, 2πœ‹]. (at least 3)

e) Create a function file to evaluate the multivariable function f(x,y,z) below.

𝑓 π‘₯,𝑦, 𝑧 = π‘₯!𝑦

π‘₯! + 𝑦! + 𝑧 !π‘₯

evaluate the function at the following points: (1,1,1), (1,0,1), (e3,1,5).

f) Consider an object, whose position along the x-axis is given by:

π‘₯ = 1 2𝑔𝑑

! create a function that has time as an input and returns the position (along x) of the object, the x-axis velocity at time β€œt” and the acceleration of the object. (hint: think about how many outputs the function must have and how to relate the velocity and acceleration to the given function). Plot the above quantities from t = 0 to 10 with 100 elements. You should use subplot where, from top to bottom the plots should be in the order: position, velocity, acceleration. All plots should be labeled appropriately.

g) Create anonymous functions in your script file to define and evaluate the following functions: i. 𝑓 π‘₯ = π‘₯! + 4π‘₯ + 6 for x = 1,5,10 ii. 𝑓 π‘₯,𝑦 = π‘₯𝑦 + π‘₯!𝑦 βˆ’ 𝑦!(π‘₯ βˆ’ 1) for (1,4), (-1,-4), (4,1) iii. 𝑓 π‘₯,𝑦 = sin π‘₯ + cos 2𝑦 for (0,0), ( !

! , ! ! )

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Writedemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to clickΒ on β€œOrder Now” and we will direct you to ourΒ Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible forΒ 20% offΒ in their first Order. Our payment method is safe and secure.

Hire a tutor todayΒ CLICKΒ HEREΒ to make your first order