Skip to main content
1-Visitor
November 19, 2016
Question

Loop Function Issue

  • November 19, 2016
  • 2 replies
  • 1840 views

As I am trying to solve one problem for my project, I am facing difficulties to solve the loop.

I am looking for Buckling Pressure for different L.b and K value.

Can you please help me out.

2 replies

23-Emerald I
November 21, 2016

Couple things:

  1. A range variable is NOT a vector; it cannot be addressed by an index.  There is an "undocumented feature" that if you follow the definition with an evaluation directly, it becomes a vector.  I DO NOT LIKE OR RECOMMEND THIS.  But I have employed it in the attached file.
  2. the indices in the loop were not correct.  And it didn't need to be vectorized.
isharma1-VisitorAuthor
1-Visitor
November 25, 2016

Thank you for your kind response.

I was trying to make a loop function after your modification.

Without loop function, I am getting the answer where as same formula with loop function not giving me the result

Can you look into it.

23-Emerald I
November 28, 2016

The error message is one of the few that actually has a valid meaning:  the units in your equation don't balance, the first term is energy, the second is force.  When I correct the formula (to agree with "Model"):

25-Diamond I
November 21, 2016

Fred already pointed you to the two culprits.

Here is a utility routine to create a vector using the same arguments (first, second last) as used in creating the range and a way to avoid invalid indices in the creation of P.