当前位置:网站首页>Matlab solves differential algebraic equations (DAE)
Matlab solves differential algebraic equations (DAE)
2022-07-27 08:45:00 【User 9925864】
A classmate asked a question at the weekend , He asked to solve a system of differential equations , But there is also a system of linear equations between the variables of the differential equation , This is a typical differential algebraic equation ,Matlab There is a special solution ,
What is differential algebraic equation ?
Differential algebraic equations are a class of differential equations , One or more of the dependent variable derivatives do not appear in the equation . Variables appearing in the equation that do not contain their derivatives are called algebraic variables , The existence of algebraic variables means that these equations cannot be written in explicit form y′=f(t,y).
ode15s and ode23t The solver can use singular mass matrix M(t,y)y′=f(t,y) To solve the differential index as 1 Linear implicit problem of , Include the following form of semi explicit DAE
y′0=f(t,y,z)
0 =g(t,y,z)
In this form , Because there are one or more zero values in the main diagonal , Therefore, the existence of algebraic variables will produce a singular mass matrix .
By default , The solver will automatically check the singularity of the quality matrix , To detect DAE Equations . If you know the singularity in advance , Then you can put odeset Of MassSingular Option set to 'yes'. about DAE, You can also use odeset Of InitialSlope Property provides for the solver y′(0) Initial condition estimate of .
for instance
among x1(0)=0.8;x2(0)=x3(0)=0.1;
1) Equation writing DAE form
2) Programming to solve
%%
clc
clear
close all
odefun = @(t,x)[-0.2*x(1)+x(2)*x(3)+0.3*x(1)*x(2);
2*x(1)*x(2)-5*x(2)*x(3)-2*x(2)^2;
x(1)+x(2)+x(3)-1]; % Differential equations
M = [1 0 0;0 1 0;0 0 0]; % Mass matrix
options=odeset('mass',M); % Definition mass attribute
x0=[0.8;0.1;0.1];
[t,x]=ode15s(odefun,[0 10],x0,options);
figure
plot(t,x(:,1),t,x(:,2),t,x(:,3))
grid on
legend('x1','x2','x3')边栏推荐
猜你喜欢
随机推荐
Forced login, seven cattle cloud upload pictures
MySQL Express
How to view instances of software objects in QSIM?
How to upload qiniu cloud
4274. 后缀表达式
NiO Summary - read and understand the whole NiO process
Zhongang Mining: the new energy industry is developing rapidly, and fluorine chemical products have a strong momentum
4278. 峰会
3311. Longest arithmetic
General Administration of Customs: the import of such products is suspended
What are the differences or similarities between "demand fulfillment to settlement" and "purchase to payment"?
Matlab数据导入--importdata和load函数
“寻源到结算“与“采购到付款“两者有什么不同或相似之处?
Creation and simple application of QPushButton button button
Have a good laugh
Oppo self-developed large-scale knowledge map and its application in digital intelligence engineering
Day4 --- flask blueprint and rest ful
3428. 放苹果
General view, DRF view review
无法获取下列许可SOLIDWORKS Standard,无法找到使用许可文件。(-1,359,2)。









