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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Simple for-loop gone wrong

rfechner
1-Visitor

Simple for-loop gone wrong

Hello,

I am attempting to program a simple for loop to increment a single variable in an equation and plot the equation as a function of the variable.

I have attached the mathcad worksheet. The issue arises on page 3 of the worksheet. The value I am trying to find is "Sigma_max" as "e" increases from 0 to 1 in 0.01 increments. I'm sure this is easily remedied and due to my own mathcad ineptitude. What am I missing?

Thanks in advance!

-Ryan

ACCEPTED SOLUTION

Accepted Solutions

The first line of your program (sigma_max(e)) set e to 0 inches in the program.

Change that to set e equal to e.  (This sets e in the program to the argument you're passing.

Then (to get it to work) you need to pass an argument with units of length.

I don't think I believe you result, however!

View solution in original post

2 REPLIES 2

The first line of your program (sigma_max(e)) set e to 0 inches in the program.

Change that to set e equal to e.  (This sets e in the program to the argument you're passing.

Then (to get it to work) you need to pass an argument with units of length.

I don't think I believe you result, however!

Thanks Fred,

After looking at your solution, it appears I don't need a loop at all.

I just set e:=0in, 0.01in...1in

and Sigma_max(e):= ..........

And away it plots.

The values from that method look much more believable. I don't trust the results from before either!

Thanks!

Announcements

Top Tags