ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 19 Aug 2011 01:06:33 +0200Can octave call a c function?https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/I have a notebook to solve a differential equation using gsl's rkf45 algorithm. Now I realize that the equation is too stiff and rkf45 is may not be the right algorithm to use. The function I am trying to solve is written in C syntax. I want to try using octave's lsode to solve the same equation since it has a option of solving "stiff" equation. I don't know the jacobian of the equation so I can't use the stiff options in gsl. The problem is that my function is very complicated it took me a long time to type it out. So my question is - is it possible to solve a differential equation in octave where the rhs is written in C syntax.Thu, 18 Aug 2011 18:23:49 +0200https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/Comment by benjaminfjones for <p>I have a notebook to solve a differential equation using gsl's rkf45 algorithm. Now I realize that the equation is too stiff and rkf45 is may not be the right algorithm to use. The function I am trying to solve is written in C syntax. I want to try using octave's lsode to solve the same equation since it has a option of solving "stiff" equation. I don't know the jacobian of the equation so I can't use the stiff options in gsl. The problem is that my function is very complicated it took me a long time to type it out. So my question is - is it possible to solve a differential equation in octave where the rhs is written in C syntax.</p>
https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/?comment=21351#post-id-21351This sounds like a question about Octave which is a completely different and separate system from Sage.Thu, 18 Aug 2011 21:42:10 +0200https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/?comment=21351#post-id-21351Comment by Shashank for <p>I have a notebook to solve a differential equation using gsl's rkf45 algorithm. Now I realize that the equation is too stiff and rkf45 is may not be the right algorithm to use. The function I am trying to solve is written in C syntax. I want to try using octave's lsode to solve the same equation since it has a option of solving "stiff" equation. I don't know the jacobian of the equation so I can't use the stiff options in gsl. The problem is that my function is very complicated it took me a long time to type it out. So my question is - is it possible to solve a differential equation in octave where the rhs is written in C syntax.</p>
https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/?comment=21346#post-id-21346Sorry about that. I thought since I can call octave from sage notebooks it may not be too off the sage discussion.Fri, 19 Aug 2011 00:30:16 +0200https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/?comment=21346#post-id-21346Answer by Volker Braun for <p>I have a notebook to solve a differential equation using gsl's rkf45 algorithm. Now I realize that the equation is too stiff and rkf45 is may not be the right algorithm to use. The function I am trying to solve is written in C syntax. I want to try using octave's lsode to solve the same equation since it has a option of solving "stiff" equation. I don't know the jacobian of the equation so I can't use the stiff options in gsl. The problem is that my function is very complicated it took me a long time to type it out. So my question is - is it possible to solve a differential equation in octave where the rhs is written in C syntax.</p>
https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/?answer=12588#post-id-12588Before going overboard, how about you try the other algorithms that GSL supports? See http://www.sagemath.org/doc/reference/sage/gsl/ode.html Fri, 19 Aug 2011 00:36:31 +0200https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/?answer=12588#post-id-12588Comment by Shashank for <p>Before going overboard, how about you try the other algorithms that GSL supports? See <a href="http://www.sagemath.org/doc/reference/sage/gsl/ode.html">http://www.sagemath.org/doc/reference...</a> </p>
https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/?comment=21345#post-id-21345That is the problem. All the gsl algorithms that solve stiff equations have to be provided with a jacobian. I don't know the jacobian. Its too complicated. lsode on the other hand numerically estimates the jacobian. I don't think any of the gsl algorithms do that.Fri, 19 Aug 2011 01:06:33 +0200https://ask.sagemath.org/question/8278/can-octave-call-a-c-function/?comment=21345#post-id-21345