[Top][All Lists]

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

How to pass time-dependent vectors with lsode

From: Ferdinando
Subject: How to pass time-dependent vectors with lsode
Date: Mon, 8 Aug 2016 11:02:25 -0700 (PDT)

Hi Everyone,

I'm trying to solve this problem in Octave. I am working on a particle track
data where I can extract the information of local intensity (I) and time. 
Now I want to pass these information to lsode where i calculate a first
order concentration (C) decay like this: dCdt = -k*I*C. 
I have difficulties to pass the time-dependent vector I(t).
Can anyone help me in this?

Here an example:

time=[0 1 2 3 4 5];
I = [0 1 1 2 2 0];
local_time = [0 1 1 1 1 1];

C0 = 100;


function dCdt=myODE(x,time,I)
k = 0.01;

C = x(1);

dCdt = -k.*I.*C;


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]