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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Can I get more than one output from a program

h_nas
4-Participant

Can I get more than one output from a program

I am trying to get three output from the same preogram. is that posible?

30 REPLIES 30

Hinnd Naser wrote:

I am trying to get three output from the same program. is that posible?

Yes, just a matter of programinging for that end.

RichardJ
19-Tanzanite
(To:jeanGiraud)

Yes, just a matter of programinging for that end.

While that answer is undeniably correct, I don't think it's all that useful!

Richard Jackson wrote:

Yes, just a matter of programinging for that end.

While that answer is undeniably correct, I don't think it's all that useful!

Quite correct in this "Théâtre des variétés" !

RichardJ
19-Tanzanite
(To:h_nas)

Yes, but only if the outputs all have the same units. Make the last line of the program a vector with the desired outputs.

Pointless function.gif

h_nas
4-Participant
(To:RichardJ)

Hi,

can use more than one input, and get an output for each one.

Thank you

RichardJ
19-Tanzanite
(To:h_nas)

Sure. If Pointless is a function definition just pass the function more than one argument. Or if Pointless is just a variable assignment rather than a function definition, it will pick up on any variables defined prior to the program in the worksheet.

Pointless function 2.gif

h_nas
4-Participant
(To:RichardJ)

Hi,

The examples you provided at the time where very helpful. However at the moment I am looking at an input coming from a matrix, say x value will be from 1 to 100, if I run for example the pointless program in the end I will get the answer for the last run, but I need instead the output for all x values from 1 to 100?

Thanks in advance for any help.

MikeArmstrong
5-Regular Member
(To:h_nas)

Please provide a worksheet of you data. Simple example shown below.

Example.jpg

Mike

h_nas
4-Participant
(To:MikeArmstrong)

Hi,

See attached a simple example of what I would like to do, and what I get from mathcad, I am unable to change the units of the output either.

Hinnduntitled.PNG

MikeArmstrong
5-Regular Member
(To:h_nas)

I haven't got Prime at the moment, but you can convert the file below.

Firstly check that the output of the program is in Matrix instead of Table.

Clipboard01.jpg

Obviously I can't have mixed unit arrays in M15, so I have omited the units.

Mike

h_nas
4-Participant
(To:MikeArmstrong)

Does that mean I am unable to use mix of units with programs whaich have many inputs??? as at the moment my current program doesnt work ( I am getting the last run), and I have no control what so ever on the output units!!!

MikeArmstrong
5-Regular Member
(To:h_nas)

Does that mean I am unable to use mix of units with programs whaich have many inputs??? as at the moment my current program doesnt work ( I am getting the last run), and I have no control what so ever on the output units!!!

No, Mathcad Prime allows mixed unit arrays. Have you converted my worksheet to Prime?

Mike

h_nas
4-Participant
(To:MikeArmstrong)

Hi,

Sorry the MP1 was crashing, however I got a result but I cannt change the output unit to bar & m^3/hr.untitled.PNG

and one of my equations is V, and MP1 consider it as a unit V, not as a parameter!!!!

MikeArmstrong
5-Regular Member
(To:h_nas)

I'm not 100% certain, but I'm sure Mathcad Prime defaults to the standard dimension system when dealing with Mixed units arrays. It seems to be defaulting to SI.

Mike

Fred_Kohlhepp
23-Emerald I
(To:h_nas)

It's not clear what you want. Are you solving for the product of the two terms? Or just returning M and N?

Try adding one line to you program:

h_nas
4-Participant
(To:Fred_Kohlhepp)

No, I am not solving the product of two terms, I am returnig M and N.

Fred_Kohlhepp
23-Emerald I
(To:h_nas)

HinndNaser wrote:

No, I am not solving the product of two terms, I am returnig M and N.

So why do you need to program it?

I agree with Fred, unless your trying to learn the principles of programming, I would use a range as Fred has.

Mike

h_nas
4-Participant
(To:MikeArmstrong)

Thank you, for your help.

I went with your example for example sake, My original program has many inputs, I need to run the calcs four times min (each run has six complex equations) , for differnt set of input. at the moment I am using MP1 table for inputs i.e. I am using the loop so the inputs will be read from the table depending on the the counter value i.

The errors I am getting is:

  1. I am getting the result for the last run.
  2. One of my equations is V, but when I type V in the result or return step, MP1 considering V as a unit (volt).
  3. I am unable to change the units of the output, for example (kPa to bar) and (°C to °F).

Thanks for your help anyway, I will see what PTC have to say about these issues.

Regards,

Hinnd

MikeArmstrong
5-Regular Member
(To:h_nas)

The errors I am getting is:

  1. I am getting the result for the last run.
  2. One of my equations is V, but when I type V in the result or return step, MP1 considering V as a unit (volt).
  3. I am unable to change the units of the output, for example (kPa to bar) and (°C to °F).
  1. That will be the way you have set the program up. You have posted an example above where a range of results has been calculated.
  2. It is good practice to keep away from built in variables.
  3. As I stated before, I believe this is a limitation of Mathcad Prime 1.0.

Thanks for your help anyway, I will see what PTC have to say about these issues.

Good luck.

Mike

h_nas
4-Participant
(To:MikeArmstrong)

Hi,

I found a perfect example in mathcad 15 help tap, it is just what I am looking for (which is a miracl), however, when I re write the same program I don't get the same result. I will attach it soon.

MikeArmstrong
5-Regular Member
(To:h_nas)

Can you please upload your latest worksheet?

Mike

h_nas
4-Participant
(To:MikeArmstrong)

Hi,

Below example from Mathcad 15, please note that I cant get the same answer.

h_nas
4-Participant
(To:MikeArmstrong)

and Mathcad program as attached.

MikeArmstrong
5-Regular Member
(To:h_nas)

Like the attached? You hadn't incluided the Matrix transpose operator.

Clipboard01.jpg

Mike

h_nas
4-Participant
(To:MikeArmstrong)

Go a head and have a try, and show me!!

MikeArmstrong
5-Regular Member
(To:h_nas)

Worksheet attached.

Mike

h_nas
4-Participant
(To:MikeArmstrong)

See what I get when I do the same!!

Hinnd

MikeArmstrong
5-Regular Member
(To:h_nas)

Double left click and select Display Options and check the Expand nested arrays box.

Mike

Top Tags