SystemsOfODEs - Maple Help

Online Help

All Products    Maple    MapleSim


ODE Steps for Systems of ODEs

 

Overview

Examples

Overview

• 

This help page gives a few examples of using the command ODESteps to solve systems of ordinary differential equations.

• 

See Student[ODEs][ODESteps] for a general description of the command ODESteps and its calling sequence.

Examples

withStudent:-ODEs:

high_order_ode1diffyx,x,x,x+3diffyx,x,x+4diffyx,x+2yx=0

high_order_ode1ⅆ3ⅆx3yx+3ⅆ2ⅆx2yx+4ⅆⅆxyx+2yx=0

(1)

ODEStepshigh_order_ode1

Let's solveⅆ3ⅆx3yx+3ⅆ2ⅆx2yx+4ⅆⅆxyx+2yx=0Highest derivative means the order of the ODE is3ⅆ3ⅆx3yxConvert linear ODE into a system of first order ODEsDefine new variabley1xy1x=yxDefine new variabley2xy2x=ⅆⅆxyxDefine new variabley3xy3x=ⅆ2ⅆx2yxIsolate forⅆⅆxy3xusing original ODEⅆⅆxy3x=3y3x4y2x2y1xConvert linear ODE into a system of first order ODEsy2x=ⅆⅆxy1x,y3x=ⅆⅆxy2x,ⅆⅆxy3x=3y3x4y2x2y1xDefine vectoryx=y3xy1xy2xSystem to solveⅆⅆxyx=A·yxTo solve the system find eigenvalues and eigenvectors ofAA=−3−2−4001100Eigenpairs of A−1,−1−11,−1+I,−1+I12I21,−1I,−1I12+I21Consider eigenpair−1,−1−11Solution to homogeneous system from eigenpairy1x=Consider complex eigenpair, complex conjugate eigenvalue can be ignored−1+I,−1+I12I21Solution from eigenpairUse Euler identity to write solution in terms of sin and cosSimplify expressionBoth real and imaginary parts are solutions to the homogeneous systemy2x=,y3x=General solution to the system of ODEsyx=_C1y1x+_C2y2x+_C3y3xSubstitute solutions into the general solutionyx=++First component of the vector is the solution to the ODEyx=ⅇx_C2+_C3sinx+_C2_C3cosx+_C1

(2)

macroY=y:

sys2diffYx,x=Matrix7,1,4,3·Yx

sys2ⅆⅆxyx=71−43·yx

(3)

ODEStepssys2

Let's solveⅆⅆxyx=71−43·yxSystem to solveⅆⅆxyx=A·yxTo solve the system find eigenvalues and eigenvectors ofAA=71−43Eigenpairs of A5,121,5,00Consider eigenpair, with eigenvalue of algebraic multiplicity 25,121First solution from eigenvalue5y1x=Form of the 2nd homogeneous solution wherepis to be solved for,λ=5is the eigenvalue, andvis the eigenvectory2x=ⅇλxxv+p+vNote that thexmultiplyingvmakes this solution linearly independent to the 1st solution obtained fromλ=5substitutey2xinto the systemλⅇλxxv+p+v+ⅇλxv=ⅇλxA·xv+p+vUse the fact thatvis an eigenvector ofAλⅇλxxv+p+v+ⅇλxv=ⅇλxλv+λxv+A·pSimplify equationλp+v=A·pMake use of the identity matrixIλI·p+v=A·pConditionpmust meet fory2xto be a solution to the systemλI+A·p=vChoosepto use in the second solution to the system from eigenvalue5·p=121Choice ofpp=140second solution from eigenvalue5y2x=General solution to the system of ODEsyx=_C1y1x+_C2y2xSubstitute solutions into the general solutionyx=+

(4)

sys3diffy1x,x,diffy2x,x=Matrix1,2,3,2·y1x,y2x+1,expx

sys3ⅆⅆxy1xⅆⅆxy2x=y1x+2y2x+13y1x+2y2x+ⅇx

(5)

ODEStepssys3

Let's solveⅆⅆxy1xⅆⅆxy2x=y1x+2y2x+13y1x+2y2x+ⅇxDefine vectoryx=y1xy2xSystem to solveⅆⅆxyx=1232·yx+1ⅇxDefine forcing functionfx=1ⅇxTo solve the system find eigenvalues and eigenvectors ofAA=1232Eigenpairs of A4,231,−1,−11Consider eigenpair4,231Solution to homogeneous system from eigenpairy1x=Consider eigenpair−1,−11Solution to homogeneous system from eigenpairy2x=General solution to the system of ODEs whereypxis a particular solution to the systemyx=_C1y1x+_C2y2x+ypxFundamental matrixThe fundamental matrix is defined as the matrix with columns that are the solutions to the homogeneous system with initial condition being the basis vector in the standard basis atx=0ΦxCompute the solution to the homogeneous system for each basis vector of the standard basis being the inital condition atx=0ⅆⅆxyx=A·yxLetBbe the matrix with solutions to the homogeneous system as columns evaluated atx=0B=23−111For each basis vector we need to solve the system of linear equations forCjwhich contains the values to multiply each homogeneous solution by to get the basis vector as the intital conditionB·Cj=eˆjEquation which must be executed for each basis vectorCj=·eˆjComputeCjfor j =1C1=35351st column of the fundamental matrix+=3ⅇx5+2ⅇ4x53ⅇx5+3ⅇ4x5ComputeCjfor j =2C2=35252nd column of the fundamental matrix+=2ⅇx5+2ⅇ4x52ⅇx5+3ⅇ4x5Fundamental matrixΦx=3ⅇx5+2ⅇ4x52ⅇx5+2ⅇ4x53ⅇx5+3ⅇ4x52ⅇx5+3ⅇ4x5Find a particular solution to the system of ODEs using variation of paramatersLet the particular solution be the fundamental matrix multiplied byvxand solve forvxyxx=Φx·vxTake the derivative of the particular solutionⅆⅆxyxx=ⅆⅆxΦx·vx+Φx·ⅆⅆxvxSubstitute particular solution and it's derivative into the system of ODEsⅆⅆxΦx·vx+Φx·ⅆⅆxvx=A·Φx·vx+fxThe fundamental matrix has columns that are solutions to the homogeneous system so it's derivative follows that of the homogeneous systemA·Φx·vx+Φx·ⅆⅆxvx=A·Φx·vx+fxCancel like termsΦx·ⅆⅆxvx=fxMultiply by the inverse of the fundamental matrixⅆⅆxvx=·fxIntegrate to solve forvxvx=0x·fsⅆsPlugvxinto the equation for the particular solutionyxx=Φx·0x·fsⅆsPlug in the fundamental matrix and the forcing function and computeyxx=7ⅇ4x30ⅇx3+122ⅇx57ⅇ4x2034+2ⅇx5Find a particular solution to the system of ODEs using variation of paramatersyxx=7ⅇ4x30ⅇx3+122ⅇx57ⅇ4x2034+2ⅇx5Plug particular solution back into general solutionyx=_C1y1x+_C2y2x+7ⅇ4x30ⅇx3+122ⅇx57ⅇ4x2034+2ⅇx5Solution to the system of ODEsy1xy2x=30_C212ⅇx30+20_C1+7ⅇ4x30ⅇx3+1220_C2+8ⅇx2034+20_C1+7ⅇ4x20

(6)

sys4diffy1x,x=y1x+2y2x,diffy2x,x=3y1x+2y2x+expx

sys4ⅆⅆxy1x=y1x+2y2x,ⅆⅆxy2x=3y1x+2y2x+ⅇx

(7)

ODEStepssys4

Let's solveⅆⅆxy1x=y1x+2y2x,ⅆⅆxy2x=3y1x+2y2x+ⅇxDefine vectoryx=y1xy2xConvert system into a vector equationⅆⅆxyx=+0ⅇxSystem to solveⅆⅆxyx=1232·yx+0ⅇxDefine forcing functionfx=0ⅇxTo solve the system find eigenvalues and eigenvectors ofAA=1232Eigenpairs of A−1,−11,4,231Consider eigenpair−1,−11Solution to homogeneous system from eigenpairy1x=Consider eigenpair4,231Solution to homogeneous system from eigenpairy2x=General solution to the system of ODEs whereypxis a particular solution to the systemyx=_C1y1x+_C2y2x+ypxFundamental matrixThe fundamental matrix is defined as the matrix with columns that are the solutions to the homogeneous system with initial condition being the basis vector in the standard basis atx=0ΦxCompute the solution to the homogeneous system for each basis vector of the standard basis being the inital condition atx=0ⅆⅆxyx=A·yxLetBbe the matrix with solutions to the homogeneous system as columns evaluated atx=0B=−12311For each basis vector we need to solve the system of linear equations forCjwhich contains the values to multiply each homogeneous solution by to get the basis vector as the intital conditionB·Cj=eˆjEquation which must be executed for each basis vectorCj=·eˆjComputeCjfor j =1C1=35351st column of the fundamental matrix+=3ⅇx5+2ⅇ4x53ⅇx5+3ⅇ4x5ComputeCjfor j =2C2=25352nd column of the fundamental matrix+=2ⅇx5+2ⅇ4x52ⅇx5+3ⅇ4x5Fundamental matrixΦx=3ⅇx5+2ⅇ4x52ⅇx5+2ⅇ4x53ⅇx5+3ⅇ4x52ⅇx5+3ⅇ4x5Find a particular solution to the system of ODEs using variation of paramatersLet the particular solution be the fundamental matrix multiplied byvxand solve forvxyxx=Φx·vxTake the derivative of the particular solutionⅆⅆxyxx=ⅆⅆxΦx·vx+Φx·ⅆⅆxvxSubstitute particular solution and it's derivative into the system of ODEsⅆⅆxΦx·vx+Φx·ⅆⅆxvx=A·Φx·vx+fxThe fundamental matrix has columns that are solutions to the homogeneous system so it's derivative follows that of the homogeneous systemA·Φx·vx+Φx·ⅆⅆxvx=A·Φx·vx+fxCancel like termsΦx·ⅆⅆxvx=fxMultiply by the inverse of the fundamental matrixⅆⅆxvx=·fxIntegrate to solve forvxvx=0x