ODE Steps for Systems of ODEs with IVP
Overview
Examples
This help page gives a few examples of using the command ODESteps to solve systems of ordinary differential equations with initial values.
See Student[ODEs][ODESteps] for a general description of the command ODESteps and its calling sequence.
with⁡Student:-ODEs:
high_order_ivp1≔diff⁡y⁡x,x,x,x+3⁢diff⁡y⁡x,x,x+4⁢diff⁡y⁡x,x+2⁢y⁡x=0,eval⁡diff⁡y⁡x,x,x=0=−1,eval⁡diff⁡y⁡x,x,x,x=0=2,y⁡0=1
high_order_ivp1≔ⅆ3ⅆx3y⁡x+3⁢ⅆ2ⅆx2y⁡x+4⁢ⅆⅆxy⁡x+2⁢y⁡x=0,ⅆ2ⅆx2y⁡xx=0|ⅆ2ⅆx2y⁡xx=0=2,ⅆⅆxy⁡xx=0|ⅆⅆxy⁡xx=0=−1,y⁡0=1
ODESteps⁡high_order_ivp1
Let's solveⅆ3ⅆx3y⁡x+3⁢ⅆ2ⅆx2y⁡x+4⁢ⅆⅆxy⁡x+2⁢y⁡x=0,ⅆ2ⅆx2y⁡xx=0|ⅆ2ⅆx2y⁡xx=0=2,ⅆⅆxy⁡xx=0|ⅆⅆxy⁡xx=0=−1,y⁡0=1•Highest derivative means the order of the ODE is3ⅆ3ⅆx3y⁡x▫Convert linear ODE into a system of first order ODEs◦Define new variabley1⁡xy1⁡x=y⁡x◦Define new variabley2⁡xy2⁡x=ⅆⅆxy⁡x◦Define new variabley3⁡xy3⁡x=ⅆ2ⅆx2y⁡x◦Isolate forⅆⅆxy3⁡xusing original ODEⅆⅆxy3⁡x=−3⁢y3⁡x−4⁢y2⁡x−2⁢y1⁡xConvert linear ODE into a system of first order ODEsy2⁡x=ⅆⅆxy1⁡x,y3⁡x=ⅆⅆxy2⁡x,ⅆⅆxy3⁡x=−3⁢y3⁡x−4⁢y2⁡x−2⁢y1⁡x•Define vectory→⁡x=y3⁡xy1⁡xy2⁡x•System to solveⅆⅆxy→⁡x=A·y→⁡x•To solve the system find eigenvalues and eigenvectors ofAA=−3−2−4001100•Eigenpairs of A−1+I,−1+I−12−I21,−1−I,−1−I−12+I21,−1,−1−11•Consider complex eigenpair, complex conjugate eigenvalue can be ignored−1+I,−1+I−12−I21•Solution from eigenpair•Use Euler identity to write solution in terms of sin and cos•Simplify expression•Both real and imaginary parts are solutions to the homogeneous systemy→1⁡x=,y→2⁡x=•Consider eigenpair−1,−1−11•Solution to homogeneous system from eigenpairy→3⁡