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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Results for multiple input cases

Injunear
1-Newbie

Results for multiple input cases

I am a new user to MathCAD 15. I really like the software since it displays equations in easy-to-read format and allows you to easily add text for documentation. However, it seems to me that the software (as I use it) is really only useful for "single" calculations, where you are only interested in one result.

I will often input a bunch of equations, and then go back and change some of my input variables to see how it affects my results. Basically, like a sensitivity analysis. Is there any way to do this in a way that lets you compare the results side-by-side? I will sometimes use a matrix or vector for one of my input variables, and simply put various values that I want to vary into it. This only works in certain instances though, since if you multiply two matrices together it gives a scalar result. I have tried using range variables for this, but I can't seem to get range variables to work in most of my equations...I will get an error about dimensional ranges requiring second data sets or something.

To try and explain what I want to do a bit better...let's say I have the following variables and equations, and I want to see the answers for "x" and "y" side-by-side for all of the different values of a, b, and c (and to see which values of a/b/c were used to arrive at said result):

a=5

b=2 or 3

c=3, 7, 15, or 20

x=sqrt([5+a-(b^5))]/(1-b*c^3)

y=(0.45*x^0.3)-0.4*(c-b)^2

If you reply to help, please do not post Mathcad worksheets, as I will be unable to download them. I normally switch over to Excel of TKSolver when I need to do this, but if I could easily do it within MathCAD itself it would make my life alot easier.

1 ACCEPTED SOLUTION

Accepted Solutions

Here a the functional appraoch described earlier which creates that kind of table:

23.04.png

I attach the sheet as well as a pdf print of the file. If you have difficulties with the pdf, too, post again and I'll try to split it into pics.

View solution in original post

5 REPLIES 5

Here is one way (there are others). I've changed your equations so they just give real numbers for x and y.

multiple.PNG

Alan

I will sometimes use a matrix or vector for one of my input variables, and simply put various values that I want to vary into it. This only works in certain instances though, since if you multiply two matrices together it gives a scalar result.

This is what vectorization (Ctrl & -)is made for, but it would also work only if all vetcor arguments have the same dimension.

So I guess a suitable way would be to make the expressions you want to examine (x,y) functions dependent on the values you want to vary (a,b,c). So you could immedeatly compare values side by side if you provide single input values.

A small program can then create a table consisting of all combinations of input values and the appropriate results.

If you reply to help, please do not post Mathcad worksheets, as I will be unable to download them.

Can you read an attached pdf file or do we have to resort to embedded pictures to communicate?

Here a the functional appraoch described earlier which creates that kind of table:

23.04.png

I attach the sheet as well as a pdf print of the file. If you have difficulties with the pdf, too, post again and I'll try to split it into pics.

Injunear wrote:

I am a new user to MathCAD 15. I really like the software since it displays equations in easy-to-read format and allows you to easily add text for documentation. However, it seems to me that the software (as I use it) is really only useful for "single" calculations, where you are only interested in one result.

I will often input a bunch of equations, and then go back and change some of my input variables to see how it affects my results. Basically, like a sensitivity analysis. Is there any way to do this in a way that lets you compare the results side-by-side? I will sometimes use a matrix or vector for one of my input variables, and simply put various values that I want to vary into it. This only works in certain instances though, since if you multiply two matrices together it gives a scalar result. I have tried using range variables for this, but I can't seem to get range variables to work in most of my equations...I will get an error about dimensional ranges requiring second data sets or something.

To try and explain what I want to do a bit better...let's say I have the following variables and equations, and I want to see the answers for "x" and "y" side-by-side for all of the different values of a, b, and c (and to see which values of a/b/c were used to arrive at said result):

a=5

b=2 or 3

c=3, 7, 15, or 20

x=sqrt([5+a-(b^5))]/(1-b*c^3)

y=(0.45*x^0.3)-0.4*(c-b)^2

modify your x and y expressions to make them functions:

x(a,b,c) := sqrt(...)

then x(5,2,3) will yield the value of x for a=5, b=2, and c=3

Thank you all very much for the advice, I am excited to try out these tricks!

Top Tags