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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Facing Problem in Evaluating a Vector using Program

smasanam
1-Newbie

Facing Problem in Evaluating a Vector using Program

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).

1 ACCEPTED SOLUTION

Accepted Solutions

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 😉

View solution in original post

5 REPLIES 5

Can you attach Mathcad worksheet to the message?

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 😉

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.

Can we resize and create an empty matrix dynamically based on a the input given in to variable?.

For example,

If n = 6

A 6x1 empty matrix (matrix variable name is predefined, eg., Mn ) to be generated and if 'n' value is changed to 4 it has to adjust the matrix to 4x1 and the matrix shall be empty. Is there a way to do it?.

Your elaborated explanation about this is very much appreciated because I am newbie to Mathcad.

Guess you may be looking for something Richard had posted here as reply to a similar demand:

Re: Variable sized vectors and matricies where the components can be edited by the user

or

Re: RE: define the column and rows in a matrix

Top Tags