Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula solving in vb like in HP42s calculator

Status
Not open for further replies.

Nifsound

Student
May 10, 2024
1
If I have a formula E.g. Ax=Ah*e^(m*x) [e=natural log=2.71828.......] and make a function of this. But is it then possible to write code so that out of this formula e.g. solve utm instead of Ax without having to rewrite the formula for every variable you might want to solve for. On the HP calculator 42s there is a special function for this. Is there something similar in visual basic.
 
Replies continue below

Recommended for you

Visual basic is a programming language based on .NET architecture. As a language, it would be up to you to write a solution, solving either numerically, using a try/catch block, or switch statement to determine the value for the variable you are looking to determine.
 
Write a general function sim to:


const e = 2.71828.......
f(Ax, Ah, m, x):
return Ax-(Ah*e^(m*x))​

Then using any other root finding method call that function with the variables you know and the guess for the variable you don't
 
I think the OP is asking for some coding that'll change the equation to m = 1/x*ln(Ax/Ah) ... ie if you know Ax, what "m".

Got no idea how the HP42 does this ... ask someone who coded the HP ?

"Hoffen wir mal, dass alles gut geht !"
General Paulus, Nov 1942, outside Stalingrad after the launch of Operation Uranus.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor