Setting of mass matrix

조회 수: 5 (최근 30일)
Oleksandr Maksimenko
Oleksandr Maksimenko 2019년 9월 9일
편집: Torsten 2019년 9월 9일
Hi, I have tried to set mass matrix
options = odeset('RelTol',1e-9,'AbsTol',1e-9*ones(608,1),'Mass', @(t)diag([ones(1,604) sin(t) 1 1 0]));
ode15s(@moven2,[0 L],vector,options,m,H0,x3,Ib,number,number1,number2,number3,mu);
but have obtained "Error using @(t)diag([ones(1,604),sin(t),1,1,0])
Too many input arguments"
Where is mistake?

답변 (1개)

Torsten
Torsten 2019년 9월 9일
편집: Torsten 2019년 9월 9일
options = odeset('RelTol',1e-9,'AbsTol',1e-9*ones(608,1),'Mass', @(t,y)diag([ones(1,604) sin(t) 1 1 0]));
or
options = odeset('RelTol',1e-9,'AbsTol',1e-9*ones(608,1),'MStateDependence','none','Mass', @(t)diag([ones(1,604) sin(t) 1 1 0]));
  댓글 수: 3
Oleksandr Maksimenko
Oleksandr Maksimenko 2019년 9월 9일
I understood where I had a mistake. I rewrote the function of the right parts and this error disappeared.
options = odeset('RelTol',1e-9,'AbsTol',1e-9*ones(608,1),'Mass', @(t)diag([ones(1,604) sin(t) 1 1 0]));
ode15s(@(X,Y)moven2(X,Y,m,H0,x3,Ib,number,number1,number2,number3,mu),[0 L],vector,options);
However, a new error has occurred and I do not understand what it means and how to solve it.
"Error using daeic12 (line 77)
This DAE appears to be of index greater than 1."
Torsten
Torsten 2019년 9월 9일
편집: Torsten 2019년 9월 9일
I'd check equation 605. It switches from algebraic at time t=0 to differential at t>0.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Performance and Memory에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by