Quiz 1. Summer 2020 Question XXXXXXXXXXmarks) The Taylor series for arctan is given below: atan(??) = � (−1)????2??+1 2?? + 1 ∞ ??=0 (a) Write a code to calculate the summation of the first 100 terms...

im stuck in these 3 questions.


Quiz 1. Summer 2020 Question 1. (30 marks) The Taylor series for arctan is given below: atan(??) = � (−1)????2??+1 2?? + 1 ∞ ??=0 (a) Write a code to calculate the summation of the first 100 terms of the series without use of any loops. (b) Write an m-file using loop to calculate the summation of the first 100 terms of the series without use of any loops. (c) Write a program using loop to calculate the summation of the series up to the point that the difference between summation terms become smaller than 1e-8. (d) Repeat part (a) for 10, 100, 1000, 10000, 10000 terms and plot the changes in the results versus number of terms using semilogx function. (e) Calculate the computation time for part (a) and (b) and make a comment about your observation. Question 2. (20 marks) The terminal velocity reached by a sky diver depends on many factors, including their weight, their body position as they fall, and the density of the air through which they fall. The terminal velocity is given by where • m is the sky diver's mass • g is Earth's gravitational constant • r is the atmospheric density • A is the sky diver's effective area • Cd is the sky diver's coefficient of drag (a) Assume that there is a text file in your MATLAB’s working directory that has the values of g, r, and A. Read those values and store them in variables. (b) Use the following values for the variables: g = 9.8, r = 1.2, and A = 0.5, and plot the terminal velocity as a function of the sky diver's weight and Cd; use weights from 50:500 kg and Cd from 0.5:0.01:1.5 using a subplot with surf and mesh plots. Quiz 1. Summer 2020 Question 3. (20 marks) (a) Write an m-file that creates (writes) an Excel file with three columns where the first column has the values 0:0.01:2*pi and the second and third columns have the sin and cos values of the first columns. (b) Generate a subplot where the first plot displays both sin(x) and cos(x) plots with xlabel, ylabel, grid, title, legend. (c) For the second subplot, repeat part (b) with the stem function instead of plot. Question 4. (10 marks) Plot the phase (angle) of the following function where x = linspace(-100, 100, 10000). ??(??) = ??−??√1+?? Question 5. (20 marks) Write a MATLAB function that takes a positive parameter m and prints all the prime numbers smaller than m.
May 27, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here