reduceDifferentialOrder
Reduce system of higher-order differential equations to equivalent system of first-order differential equations
Description
Examples
Reduce Differential Order of DAE System
Reduce a system containing higher-order DAEs to a system containing only first-order DAEs.
Create the system of differential equations, which includes a second-order expression. Here,x(t)
和y(t)
are the state variables of the system, andc1
和c2
是参数。将方程式和变量指定为两个符号向量:方程为符号方程的向量,而变量是符号函数调用的向量。
syms x(t) y(t) c1 c2 eqs = [diff(x(t), t, t) + sin(x(t)) + y(t) == c1*cos(t),... diff(y(t), t) == c2*x(t)]; vars = [x(t), y(t)];
Rewrite this system so that all equations become first-order differential equations. ThereduceDifferentialOrder
function replaces the higher-order DAE by first-order expressions by introducing the new variableDxt(t)
. It also represents all equations as symbolic expressions.
[newEqs, newVars] = reduceDifferentialOrder(eqs, vars)
neweqs = diff(dxt(t),t) + sin(x(t)) + y(t)-c1*cos(t)diff(y(t),t)-c2*x(t)dxt(t)) - diff(x(t),t)newvars = x(t)y(t)dxt(t)
Show Relations Between Generated and Original Variables
Reduce a system containing a second- and a third-order expression to a system containing only first-order DAEs. In addition, return a matrix that expresses the variables generated byreduceDifferentialOrder
通过该系统的原始变量。
创建一个微分方程系统,其中包括二阶和三阶表达式。这里,x(t)
和y(t)
are the state variables of the system. Specify the equations and variables as two symbolic vectors: equations as a vector of symbolic equations, and variables as a vector of symbolic function calls.
syms x(t)y(t)f(t)eqs = [diff(x(t),t,t)== diff(f(t),t,t,t,t),diff(y(t),,y(t),,t,t,t)== diff(f(t),t,t)];vars = [x(t),y(t)];
CallreduceDifferentialOrder
with three output arguments. This syntax returns matrixR
with two columns: the first column contains the new variables, and the second column expresses the new variables as derivatives of the original variables,x(t)
和y(t)
.
[neweqs,newvars,r] =降低iFferentiFentialOrder(eqs,vars)
neweqs = diff(dxt(t),t) - diff(f(t),t,t,t,t)diff(dytt(t),t) - diff(f(t),t,t,t)dxt(t)-diff(x(t),t)dyt(t) - diff(y(t),t)dytt(t) - diff(dyt(t),t)newvars = x(t)y(t)y(t)dxt(t)dyt(t)dytt(t)r = [dxt(t),diff(x(t),t)] [dyt(t),diff(y(t),t),t)]diff(y(t),t,t)]