Home > OS >  math formula wrong integration
math formula wrong integration

Time:10-23

`the formula im trying to integrate. https://prnt.sc/OMvgREyExFjd

in the task if y = 1.4 and f = 0.5 then the answer is appx 0.28991 but i get 0.608....

where did i make it wrong i rewrote code 3 times and every single time i got different answer.

import math
y = 1.4
f = 0.5
a = (1-((1 (2*y)/(y-1)-(f**2)-(math.sqrt((1 ((2*y)/(y-1))-(f**2))**2-(4*(f**2)*((2*y)/(y-1)-1)))))/(2*(f**2)*(((2*y)/(y-1))-1))))**(y/(y-1))
print(a)

CodePudding user response:

Following the picture you provided, your formula IS well implemented, in the sense that it gives the answer P(phi=0.5, 1.4) = 0.608236. (I coded it up in Python and Mathematica to test it).

What is that you are trying to accomplish here? Perhaps your text formula is wrong in the first place? Without much background, I can tell that your formula is something like

P = Pt(1 - x)^(g/(g-1))

where x is one of the roots of a 2nd order polynomial. Is this a thermodynamic/efficiency problem? Perhaps you need to revisit how you obtained P. Looks like an adiabatic process may not have been correctly integrated...

  • Related