global vars in function defined with block statement used for rk()
Subject: global vars in function defined with block statement used for rk()
From: Stavros Macrakis
Date: Tue, 17 Sep 2013 18:04:30 -0400
On Tue, Sep 17, 2013 at 5:05 PM, Ether Jones <maxima at etherjones.us> wrote:
> ...
> Why is the value of the global variable "count" equal to 1 after the rk
> integration?
> I would think the function would be called many times.
>
The function f(x) is called exactly once, and returns 1+cos(x). I think
what you want is
rk( '(f(x)), x, 0, [t, 0, 1, 0.1] )
> .
> ..
> I couldn't find how to define local static variables in the block
> statement, but the manual said that globals could be used.
>
Correct.
-s