CSE218 – General Instruction: Solved

$ 20.99
Category:

Description

➢ Try to optimize your algorithms as much as possible.
➢ There will be marks allocated for your code optimization , completeness and theorical understanding.
➢ Your File and Function names must start with your student no. Example: 1505xxx_bisection.m

1. ln (1+x) function can be expanded using Taylor series and the expanded series is given below.

Now write a Matlab function which will take the value of x and iteration (number of terms) number n and return the approximated value of ln (1+x).
Write a series of Matlab commands that will do the following things.
• Plot the ln (1+x) function for the interval -1<x<=1 with step size 0.1 using the built-in log (x) function.
• In the same plot show four approximated functions for the same interval using different number of terms (1, 3, 5, 20).
• Draw another plot showing the relative approx. error for each iteration while determining the value of ln(1.5) upto 50 terms.

2. Aerospace engineers sometimes compute the trajectories of projectiles such as rockets. A related problem deals with the trajectory of a thrown ball. The trajectory of a ball thrown by a right fielder is defined by the (x, y) coordinates as displayed in Fig. 1. The trajectory can be modeled as
y=(tan θ0 ) *x- g*x2 /(2* v02 * cos2 θ0)+y0

Find the appropriate initial angle θ0, if v0= 30 m/s, and the distance to the catcher is 90 m. Note that the throw leaves the right fielder’s hand at an elevation of 1.8 m and the catcher receives it at 1 m.
• Use graphical model to estimate the value.
• Use Secant method and False Position method to estimate the value for εs=0.5%. Report the number of iterations for each method while achieving the expected result.

➢ Note: You must write your Secant method and False Position method on separate .m file and you must pass your function as an argument to the method functions. The prototype is given below.

➢ Secant method (function , 1st initial guess, 2nd initial guess, expected relative approximation error, max iteration)

➢ False Position method (function , lower bound of the bracket, upper bound of the bracket, expected relative approximation error, max iteration)

Reviews

There are no reviews yet.

Be the first to review “CSE218 – General Instruction: Solved”

Your email address will not be published. Required fields are marked *