On Wed, Feb 4, 2009 at 5:55 AM, limist <[email protected]> wrote:
>
> Thanks Ondrej; LambertW looks similar but not close enough. :-(   I'm
> pretty sure no analytical solution exists, so it has to be solved
> numerically.
>
> How does one use msolve()?  A search through the docs doesn't seem to
> find anything...
>
> Also, with the code from my first message, I'm still getting a
> "ValueError("Symbolic value, can't compute") whether solve() or msolve
> () is used.
>
> Thanks again for your help!

If you want to solve things numerically, you first need to substitute
things using .subs(), so that you only have numbers and "x" in the
equation.

Here is the documentation for msolve:


In [1]: msolve?

Base Class:       <type 'function'>
String Form:   <function msolve at 0xb78dbf7c>
Namespace:        Interactive
File:             /home/ondra/repos/sympy/sympy/solvers/solvers.py
Definition:       msolve(args, f, x0, tol=None, maxsteps=None,
verbose=False, norm=None, modules=['mpmath', 'sympy'])
Docstring:
    Solves a nonlinear equation system numerically.

    f is a vector function of symbolic expressions representing the system.
    args are the variables.
    x0 is a starting vector close to a solution.

    Be careful with x0, not using floats might give unexpected results.

    Use modules to specify which modules should be used to evaluate the
    function and the Jacobian matrix. Make sure to use a module that supports
    matrices. For more information on the syntax, please see the docstring
    of lambdify.

    Currently only fully determined systems are supported.

    >>> from sympy import Symbol, Matrix
    >>> x1 = Symbol('x1')
    >>> x2 = Symbol('x2')
    >>> f1 = 3 * x1**2 - 2 * x2**2 - 1
    >>> f2 = x1**2 - 2 * x1 + x2**2 + 2 * x2 - 8
    >>> msolve((x1, x2), (f1, f2), (-1., 1.))
    [-1.19287309935246]
    [ 1.27844411169911]




Ondrej

--~--~---------~--~----~------------~-------~--~----~
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