Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1 Write a Matlab function that implements the Thomas algorithm to solve tridiagonal linear systems of equations in the form a1 c00 0 0

image text in transcribedimage text in transcribed

Exercise 1 Write a Matlab function that implements the Thomas algorithm to solve tridiagonal linear systems of equations in the form a1 c00 0 0 bi T2 In-1 00-1 The function should be in the form function x-tridiag. solver (e,a,c,b) Input Output x: solution to the lincar system (1) (column vector) Exercise 2 Consider the system of nonlinear ordinary differential equations y(0)- where f : R" x [0,TR",y: [0,TR. Write a Matlab function that solves the system (2) by using the third-order Adams-Bashforth scheme. To start-up the scheme (first two steps) use the Heun scheme. The function should be of the form function y,t AB3(fun, yo,T,DT,IOSTEP) Input fun: function handle representing f(y,t) y0: column vector representing the initial condition T: period of integration DT: time step IOSTEP: Input/output step. The solution is saved in the output matrix y every IOSTEP steps. Output: y: nx S matrix collecting the time snapshots of the solution to (2). Note that the total number of snapshots S (including the initial condition) is floor (T/(IOSTEP.DT))1 t: vector collecting the time instants at which the solution is saved in the output matrix y Exercise 1 Write a Matlab function that implements the Thomas algorithm to solve tridiagonal linear systems of equations in the form a1 c00 0 0 bi T2 In-1 00-1 The function should be in the form function x-tridiag. solver (e,a,c,b) Input Output x: solution to the lincar system (1) (column vector) Exercise 2 Consider the system of nonlinear ordinary differential equations y(0)- where f : R" x [0,TR",y: [0,TR. Write a Matlab function that solves the system (2) by using the third-order Adams-Bashforth scheme. To start-up the scheme (first two steps) use the Heun scheme. The function should be of the form function y,t AB3(fun, yo,T,DT,IOSTEP) Input fun: function handle representing f(y,t) y0: column vector representing the initial condition T: period of integration DT: time step IOSTEP: Input/output step. The solution is saved in the output matrix y every IOSTEP steps. Output: y: nx S matrix collecting the time snapshots of the solution to (2). Note that the total number of snapshots S (including the initial condition) is floor (T/(IOSTEP.DT))1 t: vector collecting the time instants at which the solution is saved in the output matrix y

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

Samsung Galaxy S23 Ultra Comprehensive User Manual

Authors: Leo Scott

1st Edition

B0BVPBJK5Q, 979-8377286455

More Books

Students also viewed these Databases questions