Yes, thank you. The rest is as follows:
from sympy import *
import numpy as np
M_e = 1
gamma_1 = 1.667
gamma_4 = 1.667
MW_1 = 39.948
MW_4 = 4.0026
D_4 = 5 / 39.37
D_1 = 3 / 39.37
A_4 = (np.pi / 4) * Pow(D_4, 2)
A_1 = (np.pi / 4) * Pow(D_1, 2)
a_4 = (gamma_4 + 1) / (gamma_4 - 1)
a_1 = (gamma_1 + 1) / (gamma_1 - 1)
A_4_A_1 = A_4 / A_1
M_3a = symbols('M_3a', positive=true, nonzero=true)
eqn = nonlinsolve([Eq((M_e / M_3a) * Pow((2 + (gamma_4 - 1) * Pow(M_3a, 2))
/ \
(2 + (gamma_4 - 1) * Pow(M_e, 2)), a_4 / 2), A_4_A_1), M_3a <= 1], M_3a)
print(eqn)
On Thursday, February 11, 2021 at 4:44:43 PM UTC-5 Oscar wrote:
> On Thu, 11 Feb 2021 at 21:42, mpierro3 <[email protected]> wrote:
> >
> > New to Sympy. I am trying to solve an equation for a variable with given
> boundaries and I am reviving the following error:
> >
> > M_3a = symbols('M_3a', positive=true, nonzero=true)
> > eqn = nonlinsolve([Eq((M_e / M_3a) * Pow((2 + (gamma_4 - 1) * Pow(M_3a,
> 2)) / \
> > (2 + (gamma_4 - 1) * Pow(M_e, 2)), a_4 / 2), A_4_A_1), M_3a <= 1], M_3a)
> > print(eqn)
> >
> > AttributeError: 'LessThan' object has no attribute 'as_poly'
>
> This could be a bug in sympy but the code as shown is missing most of
> the variable definitions so it's hard for me to judge. Can you post a
> complete minimum working example?
>
>
> Oscar
>
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/05a80cb8-cf32-46ff-b24a-0d0ce69b3e60n%40googlegroups.com.