Matlab project help! 

profilemzphymyeho

Matlab project help!

 

 

1. myworkdone(a,b,c) which takes three inputs: [50 pts] a: A real number. b: A real number. c: A real number. Note: You may assume that a < b < c if it helps understand the problem better but that doesn’t matter for the programming. Does: Assume that an object travels from x = a to x = b under the influence of the force given by F(x) = 1 + 3x 2 − 6x 3 − 3x 4 and then from x = b to x = c under the influence of the force given by G(x) = cos (x). Calculate the work done. Returns: This value.

 

 

2. myapproximatefun(a,b) which takes two inputs: [50 pts] a: A real number. b: A real number. Note: You may assume that a is close to b if it helps understand the problem better but that doesn’t matter for the programming. Does: Uses linear approximation f(b) ≈ f(a) + f 0 (a)(b − a) to approximate f(b) for f(x) = 4 + 8 sin (x). Returns: This approximate value of f(b).

 

3. mytrapezoid(f,a,b) which takes three inputs: [50 pts] f: A function handle. a: A real number. b: A real number. Note: You may assume that a < b. Does: Approximates R b a f(x) dx using the trapezoidal rule using n = 20 subintervals. Returns: The approximation.

 

4. myimproperintegral(f) which takes one input: [50 pts] f: A function handle. Note: You may assume that R ∞ 3 f(x) dx converges. Does: Approximates R ∞ 3 f(x) dx by calculating R 4 3 f(x) dx, R 5 3 f(x) dx, R 6 3 f(x) dx, ... until successive approximations differ by less than 10−2 . In other words while (hint!) the absolute value of the difference between successive approximations is greater than or equal to 10−2 , keep going further. Returns: The approximation.

    • 7 years ago
    • 10
    Answer(0)
    Bids(0)