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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Cannot understand this syntax

SK_10336045
4-Participant

Cannot understand this syntax

Hi. 

 

Im kind of new to mathcad and im trying to make a function whitch can calculate the equivalent line load for a road. I have used a document which has the calculation i need, but unfortunately it does not work for me. 

 

Can any of you see what is wrong, thanks in advance. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SK_10336045
4-Participant
(To:LucMeekes)

Hi thanks for the reply. I have manage to get somewhat in the right direction.

This Is where I am now. Its says that the variable is undefined.

upload_-aW1hZ2UwMDEucG5n-9197527451125744619..png

View solution in original post

7 REPLIES 7
LucMeekes
23-Emerald III
(To:SK_10336045)

1.

You've types square brackets in a simple expression. Square brackets cause the creation of an array (vector or matrix). I don't think you want an array there:

2.

You've enclosed an assignment in brackets. That is what the error message points to. What exactly is the assignment you want to make to the elements of the arrays X and Y?

3.

The first index into an array is set by the Built-in variable ORIGIN. ORIGIN = 0 in your sheet, but your program/function assumes it's 1...?

 

SK_10336045
4-Participant
(To:LucMeekes)

Hi thanks for the reply. I have manage to get somewhat in the right direction.

This Is where I am now. Its says that the variable is undefined.

upload_-aW1hZ2UwMDEucG5n-9197527451125744619..png

LucMeekes
23-Emerald III
(To:SK_10336045)

You should attach the worksheet,

Your expressions suggest that x is an array. The unknown variable is x.k (x with subscript k , instead of the k'th element of x. You should type x[k to get that, not x [Ctl _] k )

Note that you supply y as a formal parameter to the function but you do not use it...

Your utdata attempts to use the transpose of the vectors X and Y. You CANNOT use an exponent T to get the transpose. Check the Operators for the transpose operator.

After some editing I got this.

LucMeekes_0-1660813290572.png

Is this what you would expect?

 

Success!
Luc

SK_10336045
4-Participant
(To:LucMeekes)

Hi, thanks for the help you already gave me. I’m not sure if its in the ends leads to the correct answer, or maybe I do something wrong later in the process.

I am trying to calculate the coordinates for the maximum vertical tension using an iteration. When I use the ‘’code’’ you showed me I get quite far in the calculation, but in the end, Mathcad is not able to find a answer. I get the error code ‘’No solution was found. Try changing the guess value or the value TOL or CTOL’’.

But when I try using the code from the document, I’m trying to imitate I get error code when I’m trying to use the function. I get the error code ‘’this value must be an integer’’.

If anybody have time to help me I would appreciated it very much, thanks in advance.

 

I am attaching a document with the calculations I am trying to use bellow. The answer is suppose to be xmax=0.21 meters and ymax:2.3 meters.

 

Your sheet still contains the errors (you typed square brackets and so inadvertently created matrices) which Luc already pointed you to. This can also be seen in the screenshot of the posting of yours, which you marked as 'solution'.

Furthermore I can see no attempt for any iteration to find the maximum vertical tension.
After correcting the square bracket error you can use a simple solve block with "maximize" to arrive at a solution which seems to match the values you expect:

Werner_E_0-1661340084955.png

 

Plotting sigma shows that there is an equally high value approx at x=1.39 m and y=2.307 m. The solve block finds this value, too,  if you change the initial guess value for x.p from 0 to 1m.

Werner_E_1-1661341785947.pngWerner_E_2-1661341834332.png

 

 

ttokoro
20-Turquoise
(To:Werner_E)

image.png

Top Tags