Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
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...
I hope someone can help me. Thank You in advance!
Solved! Go to Solution.
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.
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
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.
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
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.
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.
Your function
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):
Now the solve block is called only once.
As we would expect, the function is three times faster:
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:
If you want to plot the data, you could either use the vectors just created
or you define a range variable
and use it for plotting (no need for vectorization; after all a range is not a vector at all!)
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.
