Question

I would appreciate if someone solve this using matlab? Four data points wew collected during a mechanical esperiment and are
0 0
Add a comment Improve this question Transcribed image text
Answer #1

In the following solution, initially the equation and the plot of the given case is computed, then the new set is computed when point P2 moves. Then lastly the effect of movement of P2 is discussed.

CASE 1 :

In the first case, the equation of the cubic splines may be computed using the following code, to get the results.

Equation Code

x = [1,2,3,5]; y[5,1,3,2] 6 pp= spline (x, y); , coeffs]unmkpp (pp) disp (The three cubic functions are as follows: fprintf

And the Results are :

Plotting the spline :

To plot the spline, follow this simple code,

x = [1 2 3 5];
y = [5 1 3 2];
xx = linspace(0,6,121);

plot(xx,csapi(x,y,xx),x,y,'ro')
title('Cubic Spline Interpolant to Four Points')
xlabel('x')
ylabel('y')

Cubic Spline Interpolant to Four Points 25 20 10 -5 -10 15

CASE 2 :

Now if the point P2 moves to (2,6), put the new values to x and y arrays in the above code, as follows,

x = [1,2,3,5];

y = [5,6,3,2];

Equation Results :

Command Window Com >>cSplineEq AThe three cubic functions are as follows (0.70833x3) (-4.125x*2) (4.4167x*1) (5x*0) (0.70833x

Plot :

Effect of Movement of P2 :

Here since the point P2 is moved along the y axis, such that it reaches the highest point in the data set given. This causes the slope of the spline to be exactly reversed. This is because the new highest point decides the slope and it must be a maxima. Hence, the slopes at other locations have to be reversed and so we achieve almost a replica of the curve.

NOTE : Feel free to ask any further queries in the comment section, down below.

Add a comment
Know the answer?
Add Answer to:
I would appreciate if someone solve this using matlab? Four data points wew collected during a...
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