I want to solve a differential equation of the form dy/dt = A
, where A
is a vector of ones.
It shouldn't be a problem at all, yet it does not work. The code is:
t = [1 2 3 4 5 6 7 8 9 10];
var = ones(1:length(t));
y_an = 1*t;
//
function yd = f1(t,y, var)
yd = var
endfunction
y0 = 1; t0 = 1;
//
y_m1 = ode(y0, t0, t, list(f1, var));
And it returns Error 98 at Line 10. But, if I modify the function as below:
function yd = f1(t,y, var)
yd = var(1)
endfunction
The code runs and it returns:
y_m1 =
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
I am truly baffled and asking for help, ie from @LutzL. This question is also related to two others:
Odd behavior of ODE in Scilab: equation dy/dx=A is not solved properly