Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 5 The height in meters, y of a projectile, as a function of time is given by meo sin(0) gm (t-to) yo where g

image text in transcribed

image text in transcribed

Problem 5

The height in meters, y of a projectile, as a function of time is given by meo sin(0) gm (t-to) yo where g 9.8 is the gravitional constant m = 10kg is nass of projectile Y0.1 is the coefficient of friction, to 0 is the initial timing, yo y(to)Im is the initial height 100 is the initial speed o the angle of launch FYI: The function y(t) is a solution of the differential equation my"()()-mg, with constraints yito) o ad t) o sin(0)) (20 points) Write a pseudocode of the bisection algorithm for computing the root of a real valued function. 2. (20 points) Implement your code as a Matlab function using the following input and outputs Input f(r) . The real valued function for which you want to find the root. a, b-An interval for which you think the root lies e tol - A tolerance e mariter A maximum number of iterations. Output r-The approximate root of your function (I/(n)) e resarray- An array of the residuals at each step. tol) The first line of your code should therefore read: function r, resarray] bisect(f,a,b, tol,maxiter) seudo ode of the Newton algorithm, for computing the root of real valued function. 4. (20 points) Implement your code as a Matlab function using the following inputs and outputs Input . ). The real valued fuxction for which you weant to ua he rt . f)- The derivative of f(z) 20-An initial guess of the root . tol A tolerance mariter A maximum number of iterations. Output r - The root of your function e resarray An array of the residuals at each step The first line of your code should therefore read: function lr, resarray]neton(f,df , x0,tol,maxiter) 5. (20 points) Write a script titled HW4.m that . Uses both methods to compute the hangtime of a projectile, with an angle of launch /4 and displays the answer on screen. . For both methods, plot the residuals at each iteration on the same plot with a log scaling on the y-axis. (Make sure your plot is properly labeled and easy to read use semilogy to create your residual plot) For all applications of your root finding algorithms, use tol -10-6

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

How do you evaluate the assumptions of regression analysis?

Answered: 1 week ago