help-octave
[Top][All Lists]
Advanced

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

Re: Slow performance on Linux


From: Evan Thomas
Subject: Re: Slow performance on Linux
Date: Tue, 19 Mar 1996 07:40:55 +1000

Francesco Potorti` wrote:
> 
> You forgot to post the definition of the driver_single function.  I
> append your code below:
> 
> #
> # Simple ODE bench mark test for Octave
> #
> 
> #
> # Set up global parms, load sripts, etc for sEPSP
> #
> 
> # These control the driver
> global freq dur height width;
> freq = 2;
> dur = 1;
> height = 1;
> width = 0.1;
> 
> # These control the internal cascade
> global alpha beta;
> alpha = [1, 1, 1];
> beta  = [0.5, 0.5, 0.5];
> 
> # These are the normal sEPSP boundary/range conditions
> global s0 t;
> s0 = [0, 0, 0, 0];
> t = (0:0.1:20)';    # <<<=== change the step size to vary run time
> #
> # Octave script for second messanger driver.
> #
> # The function produces a series of square pulse
> # paramterized by the values shown below.
> 
> function ret = driver(t)
> 
>   if( !is_vector(t) )
>     ret = driver_single(t);
>     return;
>   endif
> 
>   for i = 1:length(t)
>     ret (i) = driver_single(t (i));
>     i++;
>   endfor
> 
>   return;
> 
> endfunction
> 
> #
> # The equations "describing" the second messenger cascade
> #
> function sdot = sEPSP(s, t)
> 
>   global alpha beta;
> 
>   sdot(1) = alpha(1)*driver(t) - beta(1)*s(1);
>   sdot(2) = alpha(2)*s(1) - beta(2)*s(2);
>   sdot(3) = alpha(3)*s(2) - beta(3)*s(3);
> 
> endfunction
> #
> # Solve equations
> #
> 
> disp("Solving equations...");fflush(stdout);
> epsp = lsode("sEPSP", s0, t);

Sorry...
---------  driver_single  -------------
# The function produces a series of square pulse
# paramterized by the values shown below.
 
 
function ret = driver_single(t)
 
  global freq dur height width;
 
  ret = 0;
 
  if( t > dur+width )
    return;
  endif
 
  b = floor(t*freq)/freq;
  if( b <= t && t < b+width )
    ret = height;
  endif
 
  return;
 
endfunction
-----------------------------------------------------
Evan Thomas
Department of Anatomy & Cell Biology
University of Melbourne
Parkville, 3052
ph: 9344-5849  fax: 9344-5818


reply via email to

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