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

We are working to address an issue with subscription email notifications. In the meantime, be sure to check your favorite boards for new topics.

Nested Input Values and Equations

KG_8294030
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.

KG_8294030_0-1605041103974.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SL_9674672
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.

View solution in original post

3 REPLIES 3
SL_9674672
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.

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!

SL_9674672
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.
Top Tags