Generalized StringFunction class (1)

Recall the StringFunction-classes for turning string formulas into callable objects
f = StringFunction('1+sin(2*x)')
print f(1.2)
We would like:

an arbitrary name of the independent variable
parameters in the formula
f = StringFunction_v3('1+A*sin(w*t)', 
                      independent_variable='t',
                      set_parameters='A=0.1; w=3.14159')
print f(1.2)
f.set_parameters('A=0.2; w=3.14159')
print f(1.2)

previousnexttable of contents