Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Python and comment well 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 t[s] 0 y [m] 0 0.58 0.95 0.95 0.59

Please use Python and comment well image text in transcribed

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 t[s] 0 y [m] 0 0.58 0.95 0.95 0.59 0.01 -0.59 -0.95 -0.95 -0.59 -0.01 You need to determine the value of y at t = 0.03 s and t = 0.25 s. You choose to do this by interpolating this data on a new time axis, resampling from dt = 0.1 (as it is currently in the table above) to dt = 0.001. Write a Python program to interpolate this data using: i) Polynomial interpolation using Lagrange's Method ii) Piece-wise linear interpolation Polynomial interpolation using Vandermonde matrix. Your Python program must output two things: 1. A single figure which shows a) the raw data (black circles), b) the polynomial interpolation (green line), c) piece-wise linear interpolation (blue line) and d) the Vandermonde interpolation (red line). Include a legend and a grid. 2. Print statements for the value of y at t = 0.04 s and t = 0.25 s using each of the three interpolation schemes, printed to 3 decimal places in accuracy. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 t[s] 0 y [m] 0 0.58 0.95 0.95 0.59 0.01 -0.59 -0.95 -0.95 -0.59 -0.01 You need to determine the value of y at t = 0.03 s and t = 0.25 s. You choose to do this by interpolating this data on a new time axis, resampling from dt = 0.1 (as it is currently in the table above) to dt = 0.001. Write a Python program to interpolate this data using: i) Polynomial interpolation using Lagrange's Method ii) Piece-wise linear interpolation Polynomial interpolation using Vandermonde matrix. Your Python program must output two things: 1. A single figure which shows a) the raw data (black circles), b) the polynomial interpolation (green line), c) piece-wise linear interpolation (blue line) and d) the Vandermonde interpolation (red line). Include a legend and a grid. 2. Print statements for the value of y at t = 0.04 s and t = 0.25 s using each of the three interpolation schemes, printed to 3 decimal places in accuracy

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

More Books

Students also viewed these Databases questions

Question

2. How do they influence my actions?

Answered: 1 week ago

Question

5. If yes, then why?

Answered: 1 week ago