[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## differential algebraic equation

**From**: |
icecold45 |

**Subject**: |
differential algebraic equation |

**Date**: |
Sun, 27 Apr 2014 11:14:22 -0700 (PDT) |

Hello guys,
I have to make a simulation on a differential algebraic equation but my code
doesn't work.
I used the dassl-function the first time (I also using Octave since 2
weeks).
My code:
clear all
clf
function res = fil(c,cdot,t)
k1=0.036;
k2=0.036;
k3=0.036;
k4=0.036;
k5=3600;
k6=180;
c(1)=30*(49+48.3*sin(2*pi*t)+48.3*sin(pi*t)+23.805*cos(2*pi*t)+23.805*cos(pi*t));
res(1) = -c(1);
res(2) = cdot(1) - k1*c(1) + k2*c(2);
res(3) = cdot(2) - k2*c(2) + k3*c(3);
res(4) = cdot(3) - k3*c(3) + k4*c(4);
res(5) = cdot(4) - k4*c(4) + k5*c(5);
res(6) = cdot(5) - k5*c(5) + k6*c(6);
endfunction
t=0:0.01:10;
c0=[0;0;0;0;0;0];
cdot0=[0;0;0;0;0;0];
[c,cdot] = dassl("fil",c0,cdot0,t);
plot(t,cdot);
If I am running my code, there comes the following error:
***MESSAGE FROM ROUTINE DDASSL IN LIBRARY SLATEC.
***POTENTIALLY RECOVERABLE ERROR, PROG ABORTED, TRACEBACK REQUESTED
* AT T = 0.000000D+00 AND STEPSIZE H = 1.562500D-07 THE ITERATION
* MATRIX IS SINGULAR
* ERROR NUMBER = -8
*
***END OF MESSAGE
***JOB ABORT DUE TO UNRECOVERED ERROR.
0 ERROR MESSAGE SUMMARY
LIBRARY SUBROUTINE MESSAGE START NERR LEVEL COUNT
SLATEC DDASSL AT T = 0.000000D+ -8 1 1
error: dassl: exception encountered in Fortran subroutine ddassl_
error: called from:
error: D:\...\er2.m at line 25, column 9
Can someone help me to find my mistake?
Thanks. :)
--
View this message in context:
http://octave.1599824.n4.nabble.com/differential-algebraic-equation-tp4663795.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.

**differential algebraic equation**,
*icecold45* **<=**