Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask MATLAB Expert

Assignment: Introduction to Programming in MATLAB

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 this project will receive credit for all course outcomes.

1. Part 1 - "For" and "While" loops in MATLAB

i. Consider the approximation for sin(x) given in homework as:

sin x = x - x3/3! + x5/5! - x7/7! + x9/9! - x11/11! + x13/13! - x15/15! + x17/17!

Create a vector where each element is a term of the series. Allow the user to input the value of x (as a scalar). Sum the terms of the series using a "for" loop and create a formatted output to show the user (1) the value of the approximation, (2) the actual value of sin(x) (from the MATLAB function) and (3) the error between the two. Use values x = 2, 2.5, 3 to compare.

ii. Now consider the generalized form of the Taylor series for sin(x):

sin x = n=0(-1)n [x2n+1 / (2n + 1)!]

Sum the first 100 terms of the series and show the result as a formatted output identical to that of 1(i). Allow the user to input the value of x as a scalar. Repeat this problem with the first 250 terms. Compare the results. (Use same x values as from (i)).

iii. How many terms are required in (iii) to reduce the relative error to less than 1%? 0.00001%?

Assume that the relative error (percent) is defined as:

% Error = |(St - Sn) / St| × 100

St = sin x, St = n=0(-1)n [x2n+1 / (2n + 1)!]

where St and Sn are the true and numerical solutions, respectively. The "numerical" solution will come from the summation of terms while the true solution can be obtained using the built-in MATLAB function for sin(x). Each iteration through the loop, create a formatted output that shows (1) the iteration number, (2) the number of terms in the series and (3) the percent error between the obtained values. The output printed during the loop should be done so that a new line is created each time a new output is printed. When the loop has completed, display the result, the final percent error, and the number of terms using a single command. Save the percent error per iteration and plot % error vs. iteration when the loop has completed.

iv. For (iii), create a flowchart showing the logic of your code. Considering that this is the course project, please be sure to create this flowchart in a word editor (i.e. it must be typed!).

2. Part 2 - Processing data with MATLAB

i. Consider the 3 text files labeled "aluminum_test", "5_MIL_test" and "2_MIL_test" that are uploaded and attached to the assignment link. This data was collected when running Arizona State University's shocktube during an AEE 362 (High Speed Aerodynamics) laboratory experiment . The tests show data for 3 different shock wave experiments where shocks of different strengths were intentionally generated. Note that the first two columns represent pressure data (reported in psi) and that columns 3 and 4 show pressure data in units of Volts. Therefore, the data in columns 3 and 4 must be converted to useful units before it can be plotted. The conversion is given below, giving you a result in PSI.

PSI = 0.0418 x mV

Your task is to:

a. Load this data into MATLAB (hint: load() - you may also need to remove the text at the top of the data file).

b. Find the total time of the dataset, noting that the time between data points is 0.025 ms.

c. Add 14.0 to all the values in the second column. Plot this data together with that of the first column vs. time. Knowing that this is pressure, what appears to be happening?

d. Plot the data in columns 3 and 4 vs. time, after this data has been converted to PSI. These sensors were mounted inside the tube and represent changes in pressure over time. What can you see from the data? (quick comment)

e. The distance between the two pressure transducers is given as 48(1/32) in. Knowing this, we can use the "peaks" from the data in the plot from (d) (showing two changes in pressure at two different locations) to calculate the speed of the resulting shockwave. After generating the plot, use the "cursor tool" and find the Δt between the two peaks (you may also need to zoom- in considering it is the first two peaks we are interested in). The velocity of the wave can then be calculated using:

Δx / Δt

where Δx is the distance between pressure sensors. Compare shock speeds between the materials (no comments/analysis needed - but look at the results!). The material strengths are in the order: 5 Mil, 2Mil, Aluminum.

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M92043051

Have any Question?


Related Questions in MATLAB

Recitation problems -1 determine the highest real root of

Recitation Problems - 1. Determine the highest real root of f(x) = 2x 3 - 11.7x 2 + 17.7x - 5 using the Newton-Raphson method with at least four iterations. Start with an initial guess of x 0 = 3. 2. Determine the real r ...

Question - verify the attached paper with matlab and get

Question - Verify the attached paper with matlab and get all the results in the paper and explain step by step the matlab code. Paper - Improving Massive MIMO Belief Propagation Detector with Deep Neural Network. Attachm ...

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

Suppose that you have used some concept learning algorithm

Suppose that you have used some concept learning algorithm to learn a hypothesis h1 from some training data. You are interested in knowing the accuracy that the hypothesis can be expected to achieve on the underlying pop ...

Assignment matlab programmingusing appropriate matlab

Assignment: MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Assignmentq1 find the laplace transforms of the following

Assignment Q.1 Find the Laplace transforms of the following functions: (a) t 2 + at + b and (b) sin(2nΠt/T) Q.2 Find f (t) for the following F(s) = α[ f (t)]. (i) 5/(s + 3), (ii) 1/s 2 + 25, (iii) 1/s(s+1) Q.3 Find the L ...

Discrete optimisation- solve the following two problems

Discrete Optimisation - Solve the following two problems with both exhaustive enumeration and branch and bound - Problem 1 is a mixed integer linear optimisation problem (the problem has both discrete and continuous vari ...

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

Suppose that a student has the option of enrolling for a

Suppose that a student has the option of enrolling for a single elective during a term. The student must select a course from a limited list of options: "English, " "History, " "Biology, " "Computer, " or "Math." Constru ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As