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

Loop in Mathcad

NM_10165576
13-Aquamarine

Loop in Mathcad

Hello everyone,
in the attached file, the program should loop through length of dS and store the values in RA. 
could someone explain me, why the loop is not working
attached the Mathcad 10 file.

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:NM_10165576)

Is this more like the result you were expecting?  A change of the outer loop variable to i, moving the d1 assignment into the loop, and deletion of the i←i+1 statement at the bottom of the loop.

 

2024 10 24 B.png

 

Stuart

View solution in original post

4 REPLIES 4
StuartBruff
23-Emerald III
(To:NM_10165576)

I don't know what you were expecting to happen, but structurally your program can be summarized as follows:

 

2024 10 24 A.png

 

d1 takes one value (28 cm) and executes the for-loop just the once.  The inner loops also only execute once because nob only gets set to zero, hence lloop becomes 0,2..nob -> 0,2..0 which means the n2 loop executes just once, as 0 is the end condition.

 

Stuart   

 


@NM_10165576 wrote:

Hello everyone,
in the attached file, the program should loop through length of dS and store the values in RA. 
could someone explain me, why the loop is not working
attached the Mathcad 10 file.


Hi,

please explain why do you think that the loop is not working.

I added single line at the end of the 1st page. Is the result incorrect?

MartinHanak_0-1729753780495.png

 


Martin Hanák
StuartBruff
23-Emerald III
(To:NM_10165576)

Is this more like the result you were expecting?  A change of the outer loop variable to i, moving the d1 assignment into the loop, and deletion of the i←i+1 statement at the bottom of the loop.

 

2024 10 24 B.png

 

Stuart

yeah this is what i was looking for. Thank you. 

Announcements

Top Tags