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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Translate the entire conversation x

How to generate an output table

PL_14431742
2-Explorer

How to generate an output table

Hello,

 

beginner here! Can someone please help and tell me how I can generate a table or vector for my values a_hoch and a_l? I want Mathcad to calculate a_l dependent on a_hoch for different a_hoch. Is there any possibility Mathcad can do that so that I dont have to type everything individually?

So in the picture a_hoch is 460. But I also want solutions for 461, 462, 463, and so on...

 

PL_14431742_0-1765290902513.png

I hope someone can help me. Thank You in advance!

 

ACCEPTED SOLUTION

Accepted Solutions

Unfortunately, I’ve only got Mathcad Express not Mathcad Prime, so I can’t check your worksheet.  However, you have a few options available to you.

 

2025 12 09 A.png

 

I've replaced your function a_l with something that does evaluate in Mathcad Express.  Delete (or disable) it, and the expressions should work with your a_l.

 

You could also write a short program using a for or while loop to iterate over your a_hoch values.

 

Stuart

View solution in original post

2 REPLIES 2

Unfortunately, I’ve only got Mathcad Express not Mathcad Prime, so I can’t check your worksheet.  However, you have a few options available to you.

 

2025 12 09 A.png

 

I've replaced your function a_l with something that does evaluate in Mathcad Express.  Delete (or disable) it, and the expressions should work with your a_l.

 

You could also write a short program using a for or while loop to iterate over your a_hoch values.

 

Stuart

Werner_E
25-Diamond I
(To:PL_14431742)

Some remarks:

You function "a_lang" does not make use of its fourth argument, "xhoch". So you could omit this argument and also can do without your a_lang_local.

Its not mandatory but I would suggest to put the initial guess values inside the solve block.

Werner_E_0-1765303611657.png

I noticed that your solve block fails for x-values (a_hoch) which are higher than 669.3844... (obviously for this value a_lang gets zero. 

Werner_E_2-1765303675685.png

 

Your function

Werner_E_3-1765303705988.png
works OK  but its inefficient because it calls the solve block three times. Thats quite time consuming if you think on creating a table of values or plotting.

Here is a more efficient way to define that function (the transpose operator was only used because it takes up less vertical space that way):

Werner_E_4-1765303842116.png

Now the solve block is called only once.

As we would expect, the function is three times faster:

Werner_E_5-1765304016852.png

 

Now for creating a table of values as was already explained by Stuart.

In a first step you would create a vector of x/a_hoch values. You can manually type in the values, use a range variable to index the vector elements, use the "matrix" function or make use of the "vec" function shown in the picture above. A "vec" function is built-in starting with Prime 11.

After you created your vector you use it as the argument for your or mine a_l(2) function. Note that you have to vectorize the function call (the arrow over the expression).

You can use "augment" to create a table with two columns and may also add a header using the "stack" function:

Werner_E_6-1765304386140.png

If you want to plot the data, you could either use the vectors just created

Werner_E_7-1765304676077.png

or you define a range variable

Werner_E_8-1765304748326.png

and use it for plotting (no need for vectorization; after all a range is not a vector at all!)

Werner_E_9-1765304768712.png

Prime 10 worksheet attached

EDIT: File attachment did not work using the mcdx file. It was only after zipping it that the file (the zip archive)  was accepted.

 

Announcements

Top Tags