Ask Your Question

Can octave call a c function?

asked 2011-08-18 18:23:49 +0200

Shashank gravatar image

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.

edit retag flag offensive close merge delete


This sounds like a question about Octave which is a completely different and separate system from Sage.

benjaminfjones gravatar imagebenjaminfjones ( 2011-08-18 21:42:10 +0200 )edit

Sorry about that. I thought since I can call octave from sage notebooks it may not be too off the sage discussion.

Shashank gravatar imageShashank ( 2011-08-19 00:30:16 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-08-19 00:36:31 +0200

Volker Braun gravatar image

Before going overboard, how about you try the other algorithms that GSL supports? See

edit flag offensive delete link more


That 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.

Shashank gravatar imageShashank ( 2011-08-19 01:06:33 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-08-18 18:23:49 +0200

Seen: 427 times

Last updated: Aug 19 '11