Skip to main content
7-Bedrock
August 18, 2022
Solved

Cannot understand this syntax

  • August 18, 2022
  • 1 reply
  • 3364 views

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. 

 

 

Best answer by SK_10336045

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

1 reply

23-Emerald IV
August 18, 2022

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_103360457-BedrockAuthorAnswer
7-Bedrock
August 18, 2022

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

23-Emerald IV
August 18, 2022

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