Skip to main content
1-Visitor
December 27, 2016
Solved

Facing Problem in Evaluating a Vector using Program

  • December 27, 2016
  • 2 replies
  • 3061 views

Hi All,

I am trying to evaluate the deflection of a simply supported beam (which is subjected to 3 nos. of trapezoidal loads with different start and end ordinates and start and end points on the span of the beam). I tried to formulate the calculation using programming options of the Mathcad. Somehow I ran into a mistake and I could not able to trace the mistake. Can someone please help in finding the mistake.

For a clear picture of the problem, please refer to the attached snapshot.

Also, the value of deflection at the supports of the simply supported beam shall always be zero irrespective of the loading condition but in my case, the deflections at the support locations are very close to zero but not zero (snapshot is attached for the same).

Best answer by Werner_E

Use different names for the yellow and the green variables!

Another option is to get rid of the green variable alltogether and use TotalDeflection[i instead of just TotalDeflection. Only the last line should return the full vector and therefor is just TotalDeflection. You won't need the vector index j in Deflection - no need to keep those values:


Concerning the other problem it may simply be because of numerical inaccuracies, round off errors. There is not much you can do against it, but you might consider to set the zero threshold to a lower value (default is 15, so you may set it to 13 or lower). You do this by activating the "result format" window for this evaluation (either double click on the result or via menu) and then go to the "tolerance" tab.

The result will still be inaccurate, but at least you will see just a zero 😉

2 replies

24-Ruby III
December 28, 2016

Can you attach Mathcad worksheet to the message?

Werner_E25-Diamond IAnswer
25-Diamond I
December 28, 2016

Use different names for the yellow and the green variables!

Another option is to get rid of the green variable alltogether and use TotalDeflection[i instead of just TotalDeflection. Only the last line should return the full vector and therefor is just TotalDeflection. You won't need the vector index j in Deflection - no need to keep those values:


Concerning the other problem it may simply be because of numerical inaccuracies, round off errors. There is not much you can do against it, but you might consider to set the zero threshold to a lower value (default is 15, so you may set it to 13 or lower). You do this by activating the "result format" window for this evaluation (either double click on the result or via menu) and then go to the "tolerance" tab.

The result will still be inaccurate, but at least you will see just a zero 😉

smasanam1-VisitorAuthor
1-Visitor
December 29, 2016

Thank you Werner Exinger for your valuable solutions. Out of the two suggested by you, the first option works perfectly but the second option ends up in an error (please refer the image below).

Error.PNG

Also, I tried to define the inner loop into a separate function and I am successful too (please refer to the image below).

Success.PNG

Files are attached for reference.