Closed artofscience closed 3 years ago
@artofscience do you mean as a string? We could use sympy
library to convert a string to a function (sympy.lambdify
) and differentiate (sympy.diff
).
I think it is nice to be able to perform the approximated approximations concept in the exact same format as the single approximation. That way, we can show that it is nothing more than performing 2 concecutive Taylor-like approximations. Since this issue is closely related to #24, I'll try to solve this one and @artofscience can work on #24 (?). I think with the current format (no need for using lambda
functions or sympy
library) I should be able to include the approximated approximations.
As per #57, this is easily done by nesting subproblems. Example
subprob1 = Subproblem(Taylor1(MMA()))
subprob2 = Subproblem(Taylor1(Linear())
prob.evaluate(x)
subprob1.update(x, prob.g, prob.dg)
subprob2.update(x, subprob1.g, subprob1.dg)
In addition accepting function calls g, dg, ddg it would also be nice to accept analytical function g, dg, ddg such that we can easily make approximations of approximations of approximations etc.
As far as I see now, this should be easily possible in current structure.