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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Help "This Value must be a scalar"

L90_STR
3-Visitor

Help "This Value must be a scalar"

I understand that my S 2 and L x are both defined as vectors.  I’m using a comparison operator (<) that compare scalars, not vectors.  I have no clue how to make an if/else if statement work.  Any assistance or advice would be extremely appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks Werner.

 

We can go one more step to clarity by simplifying the arguments.

Capture.PNG

View solution in original post

7 REPLIES 7

Bug in Prime? We must check in Mathcad 15!

bugif.png

Hi,

 

Enclosed is one way of doing it.  S2 is a constant now.

Capture.PNG

I would prefer turning all calculations. which later should deal with vectors, into functions of scalars and call these functions later vectorized with the appropriate vectors as arguments:

B.png

BTW, you don't need the "else if" statement, a simple "else" is  all thats needed.

Worksheet in P5 format attached.

 

Thanks Werner.

 

We can go one more step to clarity by simplifying the arguments.

Capture.PNG

Good idea! I had no looked at how Lx was defined and so did not notice the the expression was calculated three times from anew.

We still miss in Mathcad and Prime the option of turning a whole worksheet into a function with appropriate in- and outputs. Turning all calculations into function as I had suggested sure is the cleanest method from a math point of view but can get very clumsy and uncomfortable for more complicated worksheets.

 

I have it working now.  Thank you All  

As there seems to be no need to make S2 a vector (as Terry suggested in his first answer) the calculation can be simplified again a little bit:

B.png

Now Lx is the only argument of that function.

Top Tags