×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Excel Formula to Mathcad Formula

Excel Formula to Mathcad Formula

Excel Formula to Mathcad Formula

(OP)


I am trying to convert a complex sum created in excel to something I can manipulate in Mathcad. I am very new to mathcad to any help would be greatly appreciated. Mathcad 14 and the excel is as follows.

'= 0.3*EXP(1.15*(1.16-0.00744*du-0.0246*Wd+(1-SQRT((LN(1+((20-Wb)/(20+Wb))))^2)-0.05*Wd)*0.2))+3/(Wc+Wd+We)-0.05

du, Wd, Wb, Wc, and We are variables.

RE: Excel Formula to Mathcad Formula

Which version of Mathcad are you using? (i.e. "Mathcad Classic" version 15 or earlier, or the new "Prime" - the user interfaces are quite different.)

However, in both cases, you have a "Calculator" palette of common mathematical operators, so you just compose the expression as you see it algebraically on the printed page. There are "hot keys" for many mathematical operators and functions, but I just use the normal keyboard, and the "Calculator" palette.

"EXP" has an "e^x" symbol on the "Calculator" palette (or type "e^...")
"SQRT" has a Square Root symbol on the "Calculator" palette (and there's an "n'th root" option as well)
"LN" has an "ln" symbol on the "Calculator" palette (or type "ln(...)")

Hope this helps!

http://julianh72.blogspot.com

RE: Excel Formula to Mathcad Formula

You can also use exp() instead of what I did then you don't have write e^.

RE: Excel Formula to Mathcad Formula

(OP)
Thank you for your help.

I am trying to figure out the behavior of the equation by creating a graph and trying to figure out what has the biggest weighting in the equation (Wd) I believe and the Wb value max is 20 I believe. Any suggestions would be great

RE: Excel Formula to Mathcad Formula

Quote:

am trying to figure out the behavior of the equation by creating a graph and trying to figure out what has the biggest weighting in the equation (Wd) I believe and the Wb value max is 20 I believe. Any suggestions would be great
I am not sure what you are trying to do and how you would define that "weighting" effect you'd like to maximize.

You have a function in 5 parameters (du and Wb to We). Are you trying to find a maximum of this function? You may consider using "maximize".

RE: Excel Formula to Mathcad Formula

(OP)
Could you explain maximize function?

I am trying to define the most important parameter, the one that affects the result the most.

Ultimately I would like to create a graph that shows the value of the function with multiple parameter values.


Thank you for your help

RE: Excel Formula to Mathcad Formula

Quote:

Could you explain maximize function?
Think Mathcads built-in help is pretty good and complete, but I'll attach a file showing it.

Quote:

I am trying to define the most important parameter, the one that affects the result the most.
Still not clear how you would define "most affected" in terms of mathematics. Maybe using gradients?

Quote:

Ultimately I would like to create a graph that shows the value of the function with multiple parameter values.
You have a function in 5 parameters - to graph you would have to hold a least 3 constant (3D-plot) or better even 4. So you have to decide what you want to see.

Find attached the sheet which finds (numerically) a local maximum of the function. The results depends strongly on the initial guess values, though.

RE: Excel Formula to Mathcad Formula

To expand on what rmix22 says:

Presumably, your function describes some sort of physical process or phenomenon (you haven't given us many clues!), and each of the five parameters has a plausible range of values. In the absence of any understanding of the problem, mathematically, we can only assume that each of the parameters is valid for any value from negative infinity to positive infinity, but when modelling physical phenomena, the "valid" range is often much smaller. The mathematical solution could be visualised as a possibly very complex multi-dimensional "surface" with possibly many local maxima and minima (possibly an infinite number?), depending on the values of the 5 parameters, but if any or all of the parameters has a small valid range, the solution space could be much simpler, with only a small number of local maxima and minima; maybe only a single solution.

Consider a much simpler problem - find the maximum value of the expression:

z(x,y) = x^2 + y^2

By inspection, this function tends to infinity as either x or y approaches plus or minus infinity. However, if the valid ranges of x and y are [0.0 to 1.0] say, then there is only one maximum value that we are interested in:

z(1,1) = 2

Or an even simpler case: what is the maximum value of the following function?

y = sin(x) * x^2

There are an infinite number of local maxima and minima, each one bigger than the previous (as x increases), but if x lies in the range [0 to pi], there is a unique maximum vale of interest.

Hope this helps!

http://julianh72.blogspot.com

RE: Excel Formula to Mathcad Formula

SQRT((LN(1+((20-Wb)/(20+Wb))))^2
In this part of the equation it seems that you are taking the square root of
LN(1+((20-Wb)/(20+Wb))) and then squaring it. This doesn't make sense.

RE: Excel Formula to Mathcad Formula

@jghrist:
Don't you just LOVE "balancing" the parentheses in long expressions in Excel?!

Was the OP trying to:

a) Evaluate the terms inside the parentheses, then take the logarithm, then square it, then take the square root (which is pretty pointless); or
b) Evaluate the terms inside the parentheses, square it, take the logarithm, and then take the square root of the logarithm (which might be meaningful); or
c) Some of the embedded parentheses could be incorrectly nested, so who knows what the intent is?

It's so much easier to check your algebra in something like Mathcad rather than Excel - that alone is reason enough to go to Mathcad for complicated engineering expressions!

http://julianh72.blogspot.com

RE: Excel Formula to Mathcad Formula

(OP)
All parameters will take a value between 0 and 50 if that helps things. I am currently working on tightening the range and the result I want from the function has to fall between 0.65 and 0.95. I am trying to determine the working range of each of the parameters to achieve the target range. I know the Wd has the biggest influence on the final result.

RE: Excel Formula to Mathcad Formula

Quote (jghrist)

it seems that you are taking the square root of
LN(1+((20-Wb)/(20+Wb))) and then squaring it. This doesn't make sense
No. It's the other way round and it makes sense.

Quote (jhardy)

then take the logarithm, then square it, then take the square root (which is pretty pointless)
You have to consider that a logarithm can be negative so the root would be imaginary. It seems that the intent is to avoid that. Alternative would be the use of the absolute value but squaring has the advantage of being a continuous and differentiable function, so it may have merits. You cannot get rid of the root and squaring unless you want to introduce an absolute value or an if condition, asking if Wb is greater than 20 (the log is negative then). But of course you could simplify the expression in the log.

Quote (reggie3)

All parameters will take a value between 0 and 50 if that helps things. I am currently working on tightening the range and the result I want from the function has to fall between 0.65 and 0.95. I am trying to determine the working range of each of the parameters to achieve the target range. I know the Wd has the biggest influence on the final result.
Fine to get some additional info at last. And you are looking for a maximum in that range or what is the goal?
You might consider eliminating Wc and We and replace Wc+We by a single variable. So one variable less to struggle with.
You may also consider a brute force attack using four nested loops to find whatever you are looking for.
Good luck!

RE: Excel Formula to Mathcad Formula

It certainly isn't germane to the essence of the discussion here, but the equation that rmix22 is working with is missing a "du" in the last term.

David Simpson, PE
MuleShoe Engineering

"Belief" is the acceptance of an hypotheses in the absence of data.
"Prejudice" is having an opinion not supported by the preponderance of the data.
"Knowledge" is only found through the accumulation and analysis of data.
The plural of anecdote is not "data"

RE: Excel Formula to Mathcad Formula

Quote (zdas04 )

the equation that rmix22 is working with is missing a "du" in the last term
You are right - its seems it doesn't mater anymore for reggie3. But i am not sure what you mean. In the expression reggie3 posted in first place I see "du" only once and its there in my expression.

RE: Excel Formula to Mathcad Formula

Dang, I'm sorry. I was looking at the .pdf that Occupant posted and they had added a "du" to the last term. The OP didn't have that term and your version looks like it matches his.

David Simpson, PE
MuleShoe Engineering

"Belief" is the acceptance of an hypotheses in the absence of data.
"Prejudice" is having an opinion not supported by the preponderance of the data.
"Knowledge" is only found through the accumulation and analysis of data.
The plural of anecdote is not "data"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close