RangeVarPlot("rangevar")
RangeVarPlot("expression involving $1")
Class for making a space plot. eg. voltage as function of path between two points on a cell. For plotting, an object of this type needs to be inserted in a Graph with g.addobject(rvp) By default, the location of the path nearest the root is location 0 (the origin) of the space plot.
If the rangevar does not exist at certain places in the path it is assumed to have a value of 0.
The first form where rangevar is "v" or "m_hh", etc. is very efficient since the object can store pointers to the variables for fast plotting.
The second form is much slower since the expression must be executed by the interpreter for each point along the path for each plot. Execution of the expression is equivalent to forsec seclist for (x) f(x) where the expression is the body of f. (Hence the use of $1 to denote the arc length position of the (temporary currently accessed section.)
See also
An example is plotting the transfer impedance with
objectvar imp, rvp, g
imp = new Impedance()
rvp = new RangeVarPlot("imp.transfer($1)")
rvp... //specify range begin and end
imp... //specify impedance computation
g = new Graph()
g.addobject(rvp)
rvp.to_vector(yvec)
rvp.to_vector(yvec, xvec)
See also