主要内容

reduceDifferentialOrder

Reduce system of higher-order differential equations to equivalent system of first-order differential equations

Description

example

[newEqs,newVars] =降低差异(eqs,vars)rewrites a system of higher-order differential equationseqs作为一阶微分方程的系统newEqs通过代替衍生物eqswith new variables. Here,newVarsconsists of the original variablesvarsaugmented with these new variables.

example

[newEqs,newVars,R] =降低差异(eqs,vars)returns the matrixRthat expresses the new variables innewVars作为原始变量的衍生物vars.

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, andc1c2是参数。将方程式和变量指定为两个符号向量:方程为符号方程的向量,而变量是符号函数调用的向量。

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. ThereduceDifferentialOrderfunction 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)];

CallreduceDifferentialOrderwith three output arguments. This syntax returns matrixRwith 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)]

Input Arguments

collapse all

包含高阶微分方程的系统, specified as a vector of symbolic equations or expressions.

原始微分方程的变量, specified as a vector of symbolic functions, or function calls, such asx(t).

例子:[x(t),y(t)]

Output Arguments

collapse all

System of first-order differential equations, returned as a column vector of symbolic expressions.

Extended set of variables, returned as a column vector of symbolic function calls. This vector includes the original state variablesvarsfollowed by the generated variables that replace the higher-order derivatives ineqs.

Relations between new and original variables, returned as a symbolic matrix with two columns. The first column contains the new variablesnewVars. The second column contains their definition as derivatives of the original variablesvars.

版本历史

在R2014b中引入