Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to process the attached formula 2

Status
Not open for further replies.
Replies continue below

Recommended for you

What answer do you arrive at when you try and solve for this? How does your answer differ from the obtained answer "7.43". How confident are you that the correct answer is "7.43". I have not sat down and gone through this simple calc, but surely you should be able to figure out how to solve if you have algebraic experience? What have you tried so far, and why do you think you were right or wrong?

By the way, this question may be better served in the Student Engineering General Discussion forum.
 
For Reference:

Calculation_ab_fqwx7l.jpg
 
that's the answer I get. the Rh term is misleading ... I took it as 1/(2*0.606)+1 (not 1/(2*0.606+1)

"Hoffen wir mal, dass alles gut geht !"
General Paulus, Nov 1942, outside Stalingrad after the launch of Operation Uranus.
 
Agree with rb1957. The notation of the formula on the right is confusing. Whoever wrote this should be punished.

bad_formula_f0ebse.jpg


It's very important that engineering formulas be clearly written. Also, for formulas like this, be sure that your units cancel as expected.
 
I will provide a counter-argument that there is absolutely nothing wrong with the way that formula is written in the original image. Order of operations are clearly expressed, and from my viewpoint, easy to interpret. This is how many formula are written in a software context, maybe whomever wrote the original equation is more comfortable reading and writing as single line equations, similar to how the equation would be written in a text editor or IDE?
 
I did intent that primarily as a joke, although I do find the 2nd option much clearer. You're right though, in terms of writing software/excel or if otherwise limited to simple text, the first option is really the only choice. The equation solver that I use needs input like:

((15 x 1000 x (2.5 x 1000)^3) / (6 x 210000 x 4570 x 10000)) * (1 / (2 x 0.606) + 1)
 
can we say that the RH expression is not very clear (strictly correct I agree but an extra set of brackets would improve the clarity) ?

or even ((2*0.606)^-1 +1)

did the oP misread the RH expression ?

"Hoffen wir mal, dass alles gut geht !"
General Paulus, Nov 1942, outside Stalingrad after the launch of Operation Uranus.
 
As a general answer to the question of how to evaluate a long formula I would suggest:

- Don't use a calculator, use a spreadsheet.
- Split the formula into smaller parts then combine them.
- Double check the number of zeros in the long numbers.
- For any part where the order of operations makes a difference, check you have the order of operations right.
- Check the final result. Could it be out by 1 or more factors of 10?

Yes, the example formula is pretty easy to evaluate, but it's pretty easy to get it wrong as well.

Doug Jenkins
Interactive Design Services
 
If you think that is too complicated to understand, I would love to see you deal with this one

dy = (M_ * (B_ * y_ * (12 * A_ * A_ * A_ * D_ * F_ * H_ * K_ - 6 * A_ * A_ * B_ * (-2 * C_ * F_ * H_ * K_ + 2 * D_ * E_ * H_ * K_ + D_ * F_ * (2 * G_ * K_ + 2 * H_ * J_ + H_ * K_ * y_)) + 2 * A_ * B_ * B_ * (-6 * C_ * E_ * H_ * K_ - 3 * C_ * F_ * (2 * G_ * K_ + 2 * H_ * J_ + H_ * K_ * y_) + 3 * D_ * E_ * (2 * G_ * K_ + 2 * H_ * J_ + H_ * K_ * y_) + D_ * F_ * (3 * G_ * (2 * J_ + K_ * y_) + H_ * y_ * (3 * J_ + 2 * K_ * y_))) + B_ * B_ * B_ * (6 * C_ * E_ * (2 * G_ * K_ + 2 * H_ * J_ + H_ * K_ * y_) + 2 * C_ * F_ * (3 * G_ * (2 * J_ + K_ * y_) + H_ * y_ * (3 * J_ + 2 * K_ * y_)) - 2 * D_ * E_ * (3 * G_ * (2 * J_ + K_ * y_) + H_ * y_ * (3 * J_ + 2 * K_ * y_)) - D_ * F_ * y_ * (G_ * (6 * J_ + 4 * K_ * y_) + H_ * y_ * (4 * J_ + 3 * K_ * y_)))) + 12 * (A_ * D_ + B_ * C_) * (B_ * E_ - A_ * F_) * (B_ * G_ - A_ * H_) * (B_ * J_ - A_ * K_) * LN(A_ + B_ * y_)))/(12 * B_ * B_ * B_ * B_* B_);

What has happened to engineers these days!
 
Hi Guys and dolls

Thanks for the insight into your world and your help with this thanks to ids

As a general answer to the question of how to evaluate a long formula I would suggest:

- Don't use a calculator, use a spreadsheet.
- Split the formula into smaller parts then combine them.
- Double check the number of zeros in the long numbers.
- For any part where the order of operations makes a difference, check you have the order of operations right.
- Check the final result. Could it be out by 1 or more factors of 10?

Yes, the example formula is pretty easy to evaluate, but it's pretty easy to get it wrong as well.

This is what i was looking for thanks
 
Hey rapt, if you give me values for those variables I'll take a crack at your equation. Got nothing else to do this weekend!
 
rapt ... it's "just" about counting brackets ...

"Hoffen wir mal, dass alles gut geht !"
General Paulus, Nov 1942, outside Stalingrad after the launch of Operation Uranus.
 
Hey rapt, if you give me values for those variables I'll take a crack at your equation. Got nothing else to do this weekend!

Easy:
Let-Lambda1-14_kukbke.jpg


The formula was copy and pasted. Obviously the values I have assigned to the variables are just made up.

The top version of the py_Eval function evaluates the formula using the assigned values, the middle one returns the formula as a string with the variables converted to values, and the bottom one evaluates that string.

The function calls Python code (via pyxll), so the LN function in the string had to be converted to the Python equivalent (log).

The required code for the py_Eval function (and many others) can be downloaded from:


Doug Jenkins
Interactive Design Services
 
It is the equation for the horizontal centroid of the compression force for a trapezoidal concrete section with the Eurocode concrete stress/strain diagram in C++ code. It is not the form of the equation that was finally used. That one had real name variables, powers where applicable and was separated onto 12 lines to show the major segments of the equation to make it more readable.

I was not asking for help with it, just suggesting that the originally posted equations format is not all that unusual or complex. We are all supposed to have completed relatively high level Math courses over several years!
 
rapt said:
dy = (M_ * (B_ * y_ * (12 * A_ * A_ * A_ * D_ * F_ * H_ * K_ - 6 * A_ * A_ * B_ * (-2 * C_ * F_ * H_ * K_ + 2 * D_ * E_ * H_ * K_ + D_ * F_ * (2 * G_ * K_ + 2 * H_ * J_ + H_ * K_ * y_)) + 2 * A_ * B_ * B_ * (-6 * C_ * E_ * H_ * K_ - 3 * C_ * F_ * (2 * G_ * K_ + 2 * H_ * J_ + H_ * K_ * y_) + 3 * D_ * E_ * (2 * G_ * K_ + 2 * H_ * J_ + H_ * K_ * y_) + D_ * F_ * (3 * G_ * (2 * J_ + K_ * y_) + H_ * y_ * (3 * J_ + 2 * K_ * y_))) + B_ * B_ * B_ * (6 * C_ * E_ * (2 * G_ * K_ + 2 * H_ * J_ + H_ * K_ * y_) + 2 * C_ * F_ * (3 * G_ * (2 * J_ + K_ * y_) + H_ * y_ * (3 * J_ + 2 * K_ * y_)) - 2 * D_ * E_ * (3 * G_ * (2 * J_ + K_ * y_) + H_ * y_ * (3 * J_ + 2 * K_ * y_)) - D_ * F_ * y_ * (G_ * (6 * J_ + 4 * K_ * y_) + H_ * y_ * (4 * J_ + 3 * K_ * y_)))) + 12 * (A_ * D_ + B_ * C_) * (B_ * E_ - A_ * F_) * (B_ * G_ - A_ * H_) * (B_ * J_ - A_ * K_) * LN(A_ + B_ * y_)))/(12 * B_ * B_ * B_ * B_* B_);

Looks like an error minefield to me. Break it up into a few easily verifiable steps?

It reminds me of a video I saw once of a hunter shooting a deer at 900 yards away. Impressive marksmanship, but I guess he never heard of stalking. LOL
 
Eng16080 said:
I did intent that primarily as a joke ...

I might've posted your "good" vs "bad" pic and wouldn't have been joking.

There are "Order of Operation Snobs."

There are also "Clarity Snobs."

I'll stay in the latter group!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor