Skip to main content
14-Alexandrite
May 9, 2013
Solved

problem plotting data derived in a nested FOR Loop

  • May 9, 2013
  • 1 reply
  • 2440 views

Hi,

I have a problem plotting some data generated in a matrix derived from a nested FOR loop. I seem to have lots of problems with nested loops. The calculation proceedure is calculating fatigue crack growth from an initial crack size (depth = a and length = 2c) when exposed to stress levels applied a number of times in a block (day). The output matrix X looks to have the right data in columns but this does not seem to plot correctly?

Is there a problem with the FOR loop logic/syntax or the way I am calling the data up for the plot?

Any assistance would be appreciated.

Thanks

ross

Best answer by remslie

Alan,

Yep it is! I have used similar syntax previously but there is obviously some subtle problem with this latest effort. One again I am indebted to you for the correction. It is frustratingly simple!

Cheers and have a good day.

Ross

1 reply

19-Tanzanite
May 9, 2013

You haven't defined j outside of the program that calculates X. You need to set j:=0..last(cycles). However, I can't really test this as you haven't supplied files "cycles.txt", "comp1membrane.txt", "comp1bending.txt".

Alan

remslie14-AlexandriteAuthor
14-Alexandrite
May 9, 2013

Alan,

I am amazed and grateful at your enthusiasm to help out.

I have attached the 3 input files and would appreciate if you can find a problem.

Cheers

ross

19-Tanzanite
May 9, 2013

Is this what you were expecting to see?

BS.PNG

Alan