[Top][All Lists]

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

Can't get a differential function to work

From: tessaract87
Subject: Can't get a differential function to work
Date: Thu, 23 Oct 2014 12:17:31 -0700 (PDT)

I've created a function with the form

function ydot = f(t,y)
ydot=[-y(1).*y(2)*b; y(1).*y(2)*b-y(2)*a];

Running it results in the following:

error: 'y' undefined near line 4 column 8
error: called from:
error:   /home/tessa/Documents/Octave Models/dy.m at line 4, column 5

Trying to actually analyze with lsode results in this:

a =  0.0040000
b =    2.0000e-04
error: f: A(I): index out of bounds; value 2 out of bound 1
error: called from:
error:   f at line 4, column 3
error: lsode: evaluation of user-supplied function failed
error: lsode: inconsistent sizes for state and derivative vectors

Now, for context, this problem is from a textbook written for MATLAB, so I
have no clue if the formatting is correct (it probably isn't).

Clearly, I need to define y (somehow)- but I have no idea how.


View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

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