Skip to main content
13-Aquamarine
October 24, 2024
Solved

Loop in Mathcad

  • October 24, 2024
  • 3 replies
  • 1043 views

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.

Best answer by StuartBruff

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

3 replies

23-Emerald V
October 24, 2024

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   

 

24-Ruby III
October 24, 2024

@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

 

23-Emerald V
October 24, 2024

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

13-Aquamarine
October 24, 2024

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