How to solve DAE system using ode15s and a modified mass matrix

1 visualizzazione (ultimi 30 giorni)
I am trying to solve a system of differential algebraic equations using ode15s. I have modified the mass matrix accordingly. But I am getting an error related to 'odemass', perhaps because my new Mass matrix is singular. Can anyone help me..
Here is the error ...
* SWITCH expression must be a scalar or string constant.
Error in odemass (line 65) switch(mass)
Error in ode23t (line 180) [Mtype, Mt, Mfun, Margs, dMoptions] = odemass(FcnHandlesUsed,odeFcn,t0,y0,...
Error in TwoD_Main2 (line 22) [z,Y] = ode23t('Alphamodel2',zspan,Y0,options); *
  2 Commenti
Torsten
Torsten il 4 Lug 2016
You will have to supply your MATLAB code to get an answer to your question.
Best wishes
Torsten.
Smaran
Smaran il 4 Lug 2016
Hi, I have attached the files of my code here, Please let me know where I am going wrong..
Thanks in advance. :)

Accedi per commentare.

Risposte (1)

Torsten
Torsten il 4 Lug 2016
You must not return the derivatives in "Alphamodel2.m" for all values of r.
The solver supplies a scalar value for r each time "Alphamodel2" is called.
Evaluate A, S and T for the value of r supplied by the ODE-integrator.
Best wishes
Torsten.
  1 Commento
Smaran
Smaran il 4 Lug 2016
The 'r' vector I am using helps to find the values of Y at different radial positions of the modeled reactor. I request you to suggest the modifications that I am supposed to make the code run.
Thanks in advance.. :)

Accedi per commentare.

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by