help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with lsode


From: Olaf Till
Subject: Re: problem with lsode
Date: Tue, 2 Nov 2010 20:08:51 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Nov 01, 2010 at 04:52:43PM +0100, address@hidden wrote:
> Hi,
> I have to solve a differenital equotation of a projectile by using octave.
> But when I try to run the script I wrote, I get this message:
>
> diffsolve_ballistik
> error: eval: invalid use of statement list
> error: lsode: `__lsode_fcn__X__' is not valid as a function
> error: called from:
> error:   /home/thomas/Uni/Datpro/Übung/dp3/diffsolve_ballistik.m at line 10, 
> column 3
>
> I can't locate the problem, please help me

With Octave version 3.2.4, I get the error message:

octave:1> diffsolve_ballistik
warning: lsode: passing function body as a string is obsolete. Please use 
anonymous functions.
error: `dgl2' undefined near line 1 column 42
error: called from:
error:   __lsode_fcn__u__ at line 1, column 40
error: lsode: evaluation of user-supplied function failed
error: lsode: inconsistent sizes for state and derivative vectors
error:   /home/olaf/tp/diffsolve_ballistik.m at line 10, column 3
octave:1> 

The reason is that you must save your function 'dgl2' in a file named
'dgl2.m' . Doing this, I get the error message:

octave:1> diffsolve_ballistik
error: `z' undefined near line 12 column 13
error: called from:
error:   /home/olaf/tp/dgl2.m at line 12, column 11
error: lsode: evaluation of user-supplied function failed
error: lsode: inconsistent sizes for state and derivative vectors
error:   /home/olaf/tp/diffsolve_ballistik.m at line 10, column 3
octave:1> 

So you see that your function uses the variable 'z' without defining
it. It does not help that your script 'diffsolve_ballistik' defines
it, because that is a different scope.

Don't take me wrong, but I think that a more thorough study of Octaves
manual for basic usage would be the best in order to tackle a specific
problem.

(If possible, post in plain text, not html.)

Olaf


reply via email to

[Prev in Thread] Current Thread [Next in Thread]