MATLAB Answers

Setting of mass matrix

Oleksandr Maksimenko 님이 질문을 제출함. 9 Sep 2019
최근 활동 Torsten 님이 편집함. 9 Sep 2019
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?

  댓글 수: 0

로그인 to comment.

답변 수: 1

Torsten 님의 답변 9 Sep 2019
Torsten 님이 편집함. 9 Sep 2019

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

Thank you for the help. Unfortunately, nothing has changed
Error using @(t)diag([ones(1,604),sin(t),1,1,0])
Too many input arguments.
Error in odemass (line 59)
massM = feval(massFcn,t0,massArgs{:});
Error in ode15s (line 188)
[Mtype, Mt, Mfun, Margs, dMoptions] = odemass(FcnHandlesUsed,odeFcn,t0,y0,...
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."
I'd check equation 605. It switches from algebraic at time t=0 to differential at t>0.

로그인 to comment.



Translated by