Making my function, F4, play interface with findroot required that I
be more verbose than desired.

(F4 runs under scipy fsolve)
def F4(dof2):
        global dof1,m,G,a,dt
        args=tuple(dof1)[:-cons]+tuple(dof2)+(m,G,a,dt)
        return F3(*args)

dof1 is a list of symbols ,list([x12, z12, x22, z22, x32, z32, px12,
pz12, px22, pz22, px32, pz32, lam1, lam2, lam3])
F3 is the is the nonlinear system  lambdified in terms of all
parameters and degrees of freedom.


If F4 is rewritten as F5 then sympy.mpmath.findroot(F5,list(dof1))
accepts the inputs and returns a proper solution.


def F5(x12, z12, x22, z22, x32, z32, px12, pz12, px22, pz22, px32,
pz32, lam1, lam2, lam3):
        global dof1,m,G,a,dt
        args=tuple(dof1)[:-cons]+(x12, z12, x22, z22, x32, z32, px12,
pz12, px22, pz22, px32, pz32, lam1, lam2, lam3)+(m,G,a,dt)
        return F3(*args)

sympy.mpmath.findroot(F5,list(dof1))

Is there a clever way to get from F4 to F5 other than cutting and
pasting?

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to