## 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

EXP e^

SQRT backslash or on a palette somewhere no doubt

LN loge I think.

Cheers

Greg Locock

New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

## RE: Excel Formula to Mathcad Formula

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

## RE: Excel Formula to Mathcad Formula

## RE: Excel Formula to Mathcad Formula

@reggie3: can you tell what your concrete problem is?

## RE: Excel Formula to Mathcad Formula

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

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

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

Still not clear how you would define "most affected" in terms of mathematics. Maybe using gradients?

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

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

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

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

## RE: Excel Formula to Mathcad Formula

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.

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

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

## RE: Excel Formula to Mathcad Formula

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"