the application decic is different from the predefined syntax

56 views (last 30 days)
Hi There,
In the help center, the syntax of decic is
However, in the “analyze and manipulate differential algebraic equations”, the employment of decic is
decic(f,t0,[0.98;-0.21;zeros(3,1)],[],zeros(5,1),[],opt)
which is different from the predefined syntax.

Accepted Answer

Stephen23
Stephen23 on 27 Aug 2025 at 4:24
Edited: Stephen23 on 27 Aug 2025 at 4:29
You are looking at the wrong function help.
The text in that example states "Then use the MATLAB decic function..." so you should be looking at the MATLAB function help https://www.mathworks.com/help/matlab/ref/decic.html which has syntax:
[y0_new,yp0_new] = decic(odefun,t0,y0,fixed_y0,yp0,fixed_yp0,options)
[y0,yp0] = decic(f,t0,[0.98;-0.21;zeros(3,1)],[],zeros(5,1),[],opt)
This also makes sense conceptually, because the symbolic toolbox function DAEFUNCTION converts from symbolic equations to a MATLAB function handle (similarly to MATLABFUNCTION does), so we already know that the Symbolic Toolbox function DECIC (which lists its first inputs as symbolic equations and variables) is not the correct function.
You can also use WHICH to check this yourself.
  7 Comments
Tony Cheng
Tony Cheng on 28 Aug 2025 at 11:58
Dear Stephen,
Thanks very much for your detailed explanation. In fact, all the elements of y at t0 have been computed from our previous work, and the first 48 elements of dot_y at t0 are also available. The equality M(y)*dot_y = f(y) at t0 is met.
When I use decic with all the 66 elements of y fixed while no elements of dot_y fixed to generate y0_new and yp0_new,the command window gave me an error saying that please try to release 18 fixed components.
By contrast, when I do not specify yp0_new in odeset, the command window did not show that error, and the numerical accuracy in terms of displacement, velocity, and acceleration seems a little bit ok for me.
So is decic necessary to be used to generate y0_new and yp0_new before ode15s is used?
Thanks in advance!
Torsten
Torsten on 28 Aug 2025 at 14:10
Edited: Torsten on 28 Aug 2025 at 14:17
It is absolutly necessary to prescribe the differential variables at t = t0 of your DAE system because differential variables need initial conditions. The algebraic variables or time derivatives of variables are a "nice-to-have", but if you don't specify them and the solver manages to start the integration, all should be fine.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!