Lab_5_Interpolation_and_RootFinding

.py

School

University of Texas, Rio Grande Valley *

*We aren’t endorsed by this school

Course

2350

Subject

Civil Engineering

Date

Apr 3, 2024

Type

py

Pages

2

Uploaded by suckmyassbuddy

""" **CIVE 2350: Numerical Methods for Civil Engineers** **Lab 5: Interpolation and Root Finding** """ #%% # Add imports here # %% x = [0, 1, 3, 4, 10] y = [2, 6, 4, 8, 3] def task_1(): """ Create a linear interpolation and reurn its value at x=2.5 """ pass task_1() # %% def task_2(): """ Create a cubic spline interpolation and reurn its value at x=2.5 """ pass task_2() # %% def task_3(): """ Create a lagrangian interpolation and reurn its value at x=2.5 """ pass task_3() # %% def task_4(): """ Plot the linear, cubic spline, and lagrangian polynomial interpolations in one plot """ pass task_4() # %% f = lambda x: 2*x**2 -10 df = lambda x: 4*x def task_5():
""" Write a function to get the roots of f using the bisection method """ pass task_5() # %% def task_6(): """ Write a function to get the roots of f using the bisection method """ pass task_6() # %% def task_7(): """ return the root using scipy.optimize.root and confirm your answers in the previous two tasls """ pass task_7()
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help