On Mar 2, 8:10 pm, Sharpie <[email protected]> wrote:
> So I guess at this point my question is: is there another way to
> convert from a symbolic polynomial equation to a Polynomial Ring?  I
> The methods I used feel very hacky and I don't trust them.

Ok, so I think I found something in the manual page "Conversion of
symbolic expressions to other types" that finally clicked.  If I have:


y2 = var( 'y2' )

altDepths = 1.54027132807289 == y2 + 0.0906104881640050/y2^2 + 0.15


I can use the following function, to convert to a polynomial quotient
and then use Alex's tip to pick off the numerator and feed it to
roots():


from sage.symbolic.expression_conversions import PolynomialConverter

PolynomialConverter( y2, RR ).relation( altDepths,
operator.eq ).numerator().roots()

[(-0.236040904804615, 1), (0.286518993973450, 1), (1.33979323890406,
1)]


Probably as clean and straight-forwards as I will be able to find-- if
anyone knows a better way I would love to hear it!

-Charlie

-- 
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/sage-support
URL: http://www.sagemath.org

Reply via email to