Re: [Scilab-users] Command integrate() is too slow under certain expressions

2020-02-10 Thread Stéphane Mottelet
Sorry the ode call should be (y0 first, then x0) y = ode(-1,x0,x1,list(f,x1,y1,d1)) The elapsed time seems OK: --> tic;y = ode(-1,x0,x1,list(f,x1,y1,d1));toc  ans  =    0.002235 S. Le 11/02/2020 à 08:17, Stéphane Mottelet a écrit : Hello, The usual way to compute a primitive would be t

Re: [Scilab-users] Command integrate() is too slow under certain expressions

2020-02-10 Thread Stéphane Mottelet
Hello, The usual way to compute a primitive would be to use ode, like this: function out=f(x, y, x1, y1, d1) out = interp(x,x1,y1,d1) endfunction x0 = 0 x1 = 0:0.01:2*%pi; y1 = sin(x1); d1 = splin(x1,y1); y = ode(x0,-1,x1,list(f,x1,y1,d1)) Your proposition is very slow becau

Re: [Scilab-users] undocumented behavior of sum(), prod() and type()

2020-02-10 Thread Federico Miyara
Thanks, Samuel. This certainly clarifies how [] behaves. But is there a rationale for sum([])==0 and yet cumsum([])==[]? By the way, it would be useful to include cumsum and cumprod among the examples, or at least ensure the respective help pages include that information. Regards, Federi

[Scilab-users] Command integrate() is too slow under certain expressions

2020-02-10 Thread Federico Miyara
Dear all, The function integrate() is very handy to obtain a numerical primtive of a function, particularly useful when there is no closed form for the primitive or it is too involved. According to the documentation x = integrate(expr, v, x0, x1 [, atol [, rtol]]) expr: a character st