Systems of ODEs - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

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ⅆx3yxCharacteristic polynomial of ODEr3+3r2+4r+2=0Roots of the characteristic polynomialr=−1,−1I,−1+ISolution fromr=−1y1x=ⅇxSolutions fromr=−1Iandr=−1+Iy2x=ⅇxsinx,y3x=ⅇxcosxGeneral solution of the ODEyx=c__1y1x+c__2y2x+c__3y3xSubstitute in solutions and simplifyyx=ⅇxc__1+c__2sinx+c__3cosx

(2)

macroY=y1x,y2x:

sys2diffY,x=%.Matrix7,1,`-`4,3,Y

sys2ⅆⅆxy1xⅆⅆxy2x=71−43·y1xy2x

(3)

ODEStepssys2

Let's solveⅆⅆxy1xⅆⅆxy2x=71−43·y1xy2xDefine vectoryx=y1xy2xSystem to solveⅆⅆxyx=71−43·yxDefine the coefficient matrixA=71−43Rewrite the system asⅆⅆxyx=A·yxTo solve the system, find the eigenvalues and eigenvectors ofAEigenpairs ofA5,121,5,00Consider eigenpair, with eigenvalue of algebraic multiplicity 25,121First solution from eigenvalue5y1x=ⅇ5x121Form of the 2nd homogeneous solution wherepis to be solved for,λ=5is the eigenvalue, andvis the eigenvectory2x=ⅇλxxv+pNote that thexmultiplyingvmakes this solution linearly independent to the 1st solution obtained fromλ=5Substitutey2xinto the homogeneous systemλⅇλxxv+p+ⅇλxv=ⅇλxA·xv+pUse the fact thatvis an eigenvector ofAλⅇλxxv+p+ⅇλxv=ⅇλxλ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 homogeneous systemAλI·p=vChoosepto use in the second solution to the homogeneous system from eigenvalue571−4351001·p=121Choice ofpp=140Second solution from eigenvalue5y2x=ⅇ5xx121+140General solution to the system of ODEsy=c__1y1x+c__2y2xSubstitute solutions into the general solutiony=c__1ⅇ5x121+c__2ⅇ5xx121+140Solution to the system of ODEsy1xy2x=ⅇ5x2c__2x+2c__1+c__24ⅇ5xc__2x+c__1

(4)

sys3diffY,x=Matrix1,2,3,2·Y+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 the forcing functionfx=1ⅇxDefine the coefficient matrixA=1232Rewrite the system asⅆⅆxyx=A·yx+fTo solve the system, find the eigenvalues and eigenvectors ofAEigenpairs ofA−1,−11,4,231Consider eigenpair−1,−11Solution to homogeneous system from eigenpairy1=ⅇx−11Consider eigenpair4,231Solution to homogeneous system from eigenpairy2=ⅇ4x231General solution of the system of ODEs can be written in terms of the particular solutionypxyx=c__1y1+c__2y2+ypxFundamental matrixLetφxbe the matrix whose columns are the independent solutions of the homogeneous system.φx=ⅇx2ⅇ4x3ⅇxⅇ4xThe fundamental matrix,Φxis a normalized version ofφxsatisfyingΦ0=IwhereIis the identity matrixΦx=φx·φ0−1Substitute the value ofφxandφ0Φx=ⅇx2ⅇ4x3ⅇxⅇ4x·−12311−1Evaluate and simplify to get the fundamental matrixΦx=3ⅇx5+2ⅇ4x52ⅇx5+2ⅇ4x53ⅇx5+3ⅇ4x52ⅇx5+3ⅇ4x5Find a particular solution of the system of ODEs using variation of parametersLet the particular solution be the fundamental matrix multiplied byvxand solve forvxypx=Φx·vxTake the derivative of the particular solutionⅆⅆxypx=ⅆⅆxΦx·vx+Φx·ⅆⅆxvxSubstitute particular solution and its 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 its 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=Φx−1·fxIntegrate to solve forvxvx=0xΦs−1·fsⅆsPlugvxinto the equation for the particular solutionypx=Φx·0xΦs−1·fsⅆsPlug in the fundamental matrix and the forcing function and computeypx=122ⅇx5ⅇx3+7ⅇ4x3034+2ⅇx5+7ⅇ4x20Plug particular solution back into general solutionyx=c__1y1+c__2y2+122ⅇx5ⅇx3+7ⅇ4x3034+2ⅇx5+7ⅇ4x20Solution to the system of ODEsy1xy2x=ⅇx30c__11230+20c__2+7ⅇ4x30ⅇx3+12ⅇx20c__1+82034+20c__2+7ⅇ4x20

(6)

sys4diffwx,x=wx+2zx,diffzx,x=3wx+2zx+expx

sys4ⅆⅆxwx=wx+2zx,ⅆⅆxzx=3wx+2zx+ⅇx

(7)

ODEStepssys4

Let's solveⅆⅆxwx=wx+2zx,ⅆⅆxzx=3wx+2zx+ⅇxDefine vectorwx=wxzxConvert system into a vector equationⅆⅆxwx=1232·wx+0ⅇxSystem to solveⅆⅆxwx=1232·wx+0ⅇxDefine the forcing functionfx=0ⅇxDefine the coefficient matrixA=1232Rewrite the system asⅆⅆxwx=A·wx+fTo solve the system, find the eigenvalues and eigenvectors ofAEigenpairs ofA−1,−11,4,231Consider eigenpair−1,−11Solution to homogeneous system from eigenpairw1=ⅇx−11Consider eigenpair4,231Solution to homogeneous system from eigenpairw2=ⅇ4x231General solution of the system of ODEs can be written in terms of the particular solutionwpxwx=c__1w1+c__2w2+wpxFundamental matrixLetφxbe the matrix whose columns are the independent solutions of the homogeneous system.φx=ⅇx2ⅇ4x3ⅇxⅇ4xThe fundamental matrix,Φxis a normalized version ofφxsatisfyingΦ0=IwhereIis the identity matrixΦx=φx·φ0−1Substitute the value ofφxandφ0Φx=ⅇx2ⅇ4x3ⅇxⅇ4x·−12311−1Evaluate and simplify to get the fundamental matrixΦx=3ⅇx5+2ⅇ4x52ⅇx5+2ⅇ4x53ⅇx5+3ⅇ4x52ⅇx5+3ⅇ4x5Find a particular solution of the system of ODEs using variation of parametersLet the particular solution be the fundamental matrix multiplied byvxand solve forvxwpx=Φx·vxTake the derivative of the particular solutionⅆⅆxwpx=ⅆⅆxΦx·vx+Φx·ⅆⅆxvxSubstitute particular solution and its 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 its 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=Φx−1·fxIntegrate to solve forvxvx=0xΦs−1·fsⅆsPlugvxinto the equation for the particular solutionwpx=Φx·0xΦs−1·fsⅆsPlug in the fundamental matrix and the forcing function and computewpx=ⅇx5ⅇx3+2ⅇ4x15ⅇx5+ⅇ4x5Plug particular solution back into general solutionwx=c__1w1+c__2w2+ⅇx5ⅇx3+2ⅇ4x15ⅇx5+ⅇ4x5Substitute in vector of dependent variableswxzx=ⅇx15c__1+315+10c__2+2ⅇ4x15ⅇx3ⅇx1+5c__2ⅇ5x1+5c__15Solution to the system of ODEswx=ⅇx15c__1+315+10c__2+2ⅇ4x15ⅇx3,zx=ⅇx1+5c__2ⅇ5x1+5c__15

(8)

See Also

diff

Int

Student

Student[ODEs]

Student[ODEs][ODESteps]