drtol / goalseek_python Goto Github PK
View Code? Open in Web Editor NEWEquivalent of Excel Goal Seek function in Python
License: MIT License
Equivalent of Excel Goal Seek function in Python
License: MIT License
I defined this function inside a code:
def psi(A_3_var):
return math.atan(((1/1.75)(1/R_air)((P_34/(m_air*(T34**0.5)))**2)((A_0A_3_var/(A_0-A_3_var))2)*(d_P_diff/P_34))(1/1.22)) #all variables are declared in the previous part of the code
goal=30 #Define the goal (result)
A_30=0.0005 #Define a starting point
A_3=GoalSeek(psi,goal,A_30)
The answer is "local variable 'x_lb' referenced before assignment"
if I use this code
def psi(A_3_var):
return ((A_0*A_3_var/(A_0-A_3_var))**2)
goal=30 #Define the goal (result)
A_30=0.0005 #Define a starting point
A_3=GoalSeek(psi,goal,A_30)
The answer is "local variable 'x_lb' referenced before assignment"
if I use this code
def psi(A_3_var):
return (A_0*A_3_var)
goal=30 #Define the goal (result)
A_30=0.0005 #Define a starting point
A_3=GoalSeek(psi,goal,A_30)
I get A_3=25995.043088975697
How can I get A_3 using first and second code?
10/03/2020:
I decided to use scipy.optimize.fsolve and it works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.