cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

## Nested Input Values and Equations  3-Visitor

## Nested Input Values and Equations

First time poster, casual user of MathCAD Prime 6.0, and have a question regarding setting up an equation that has multiple variable inputs (X = 1....100, 10; Y = 2...12, 2; Z.....) and present a table of the input versus output results for the given inputs.

The equation is pretty simple but I'm struggling to figure out 1) what I am missing to make it work and 2) to display a table that would show those inputs versus the output.  Its probably something simple but it's eluding me. 1 ACCEPTED SOLUTION

Accepted Solutions  5-Regular Member
(To:KG_8294030)
It is a divide by zero problem. Use a non-zero starting point for your range variable D_s. The log of 1 is zero. C*zero is zero. i.e., Ds=0, so log((0+134)/134) = log(1) = 0. You could also add a small addition to the numerator of the log function, but it will affect your results. I can't get the file to attach, nor a screenshot.
3 REPLIES 3  5-Regular Member
(To:KG_8294030)
It is a divide by zero problem. Use a non-zero starting point for your range variable D_s. The log of 1 is zero. C*zero is zero. i.e., Ds=0, so log((0+134)/134) = log(1) = 0. You could also add a small addition to the numerator of the log function, but it will affect your results. I can't get the file to attach, nor a screenshot.  3-Visitor
(To:SL_9674672)

Thank you...they should include a warning not to play with math without coffee.

I do have a follow up question, sg in the equation is specific gravity and is unitless.  Same way with C value. If I put units on any part of the equation, the program will not continue.  I can fudge units to make it work, or completely eliminate them but defeats the purpose of the program in my opinion, but is there a way to run an equation with one or more unitless numbers among variables and numbers that have units?

Thank you!  5-Regular Member
(To:KG_8294030)
The units are cancelling out in your equation. When you assign units to the variables, Mathcad automatically includes them in the equation. It just doesn't show the units in the equation. I think the unit piece of Mathcad is the best thing about it. One of the easiest validations that your calculations are correct is to include the units and make sure the calculated result has the expected units. If you run through the calculation by hand you can see that the units cancel. 