Skip to main content
13-Aquamarine
Oct 24, 2024 5:27 AM UTC
Solved

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.

23-Emerald V
Oct 24, 2024 7:57 AM UTC

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

4 replies

23-Emerald V
Oct 24, 2024 7:07 AM UTC

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   

 

Translate
24-Ruby III
Oct 24, 2024 7:10 AM UTC

@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

 

Translate
23-Emerald V
Oct 24, 2024 7:57 AM UTC

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

Translate
13-Aquamarine
Oct 24, 2024 9:41 AM UTC

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

Translate