{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Solving ODEs with Laplace Transforms in Matlab

Solving ODEs with Laplace Transforms in Matlab - original...

This preview shows pages 1–2. Sign up to view the full content.

Solving ODEs with Laplace Transforms in Matlab In this lesson we will work with the following Matlab commands in order to strengthen our understanding of Laplace Transforms. syms laplace diff ilaplace This lesson covers the Three Step Method for solving second order ODEs. Solve the IVP x''-3x'+2x = 0, x(0)=0, x'(0) =1 using the three-step method of Laplace Transforms. Step I Use laplace to compute the Laplace transform. First declare t and s symbolic variables. syms t s laplace(diff(diff(sym('x(t)')))-3*diff(sym('x(t)'))+2*sym('x(t)')) Gives the answer ans = s*(s*laplace(x(t),t,s)-x(0))-D(x)(0)-3*s*laplace(x(t),t,s)+3*x(0)+2*laplace(x(t),t,s) Notice how Matlab has used the derivative theorem to express the answer in terms of the

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: original function. Recall L[f'] = s*L[f] - f(0) and L[f''] = s 2 L[f] - s*f(0)- f'(0) Step II Use solve to compute the solution of the algebraic equation. In order to create the algebraic equation, let the Laplace transform of x be denoted as X, and recall that x(0) =0, x'(0) = 1. That give us s 2 X -3sX+2X-1 = 0. We want to solve this in Matlab. solve('s^2*X -3*s*X+2*X-1 = 0','X') ans = 1/(s^2-3*s+2) Step III Use ilaplace to obtain the solution of the initial differential equation. ilaplace(1/(s^2-3*s+2)) ans = exp(2*t)-exp(t) Solve the following ODEs using the three-step method x'' = -4x'-8x - 10cos2t, x(0)=x'(0)=0 x'' = -x'+2x - 15e t sint, x(0)=x'(0)=0...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

Solving ODEs with Laplace Transforms in Matlab - original...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online