Question

Compute second derivative O solutions submitted (max: 10) You are provided with a set of data for the position of an object o1 function v = firstDeriv(x,h) 2 % Use (h^2) approximations to compute derivative 3 % x = evenly spaced data 4 % h = spacingMy code for calculating the first derivative is the second image

1 0
Add a comment Improve this question Transcribed image text
Answer #1

1 2 3 4 5 6 7

>> h=0.1; >> t = 0:h:2*pi; >> X =sin(t) +t. 2; >> a = second_Deriv(x,h); >> hold on; >> plot(t, a) >> plot(t, 2-sin(t))

i 3 4 function v = first_Deriv(x, h) t = length(x); v = zeros (1,t); v (1) = (-3*x(1) + 4*x (2) - x(3))/(2*h); v(t) = (3*x(t)

i 2 3 function a = second_Deriv(x, h) v = first_Deriv(x,h); a = first_Deriv(v, 1); end 4

Code

function a = second_Deriv(x,h)

v = first_Deriv(x,h);

a = first_Deriv(v,h);
end

Add a comment
Know the answer?
Add Answer to:
My code for calculating the first derivative is the second image Compute second derivative O solutions...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT