Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi! I tried to find older discussion related to rainflow counting algorithm and found some but unfortunately they lead me to new problem. I used some program created by Ian Ward and was able to create workbook for my needs. But for some reason it doesn't always work like it should. Problems occur with some initial data and are related to the array index, I believe.
Please find two identical calculation sheets attached with different initial data in embedded excel file. The file "Rainflow Cycle Counting A" works fine but the "Rainflow Cycle Counting B" does not.
Can someone advice what is the problem, please?
And another question, at the end of the calculations I have another embedded excel file to combine the rows in matrix that has identical values in the first column. For example, if I have values 3, 3, 3 in the first column and corresponding values of 2, 4, 6 in the second column, I would like to have them added so that I have row: [3, 12]. And this should be done for the whole Y2 matrix. Is there easy way to do this in the MathCad?
Thanks for your help in advance!
- Harri
I did not dig into the function "range" to find out what exactly it does, but I threw in a try...onerror statement at the offending position
This showed me that the error occurs when i=12.
At this moment qi=12, too and so you try to assign a value to vector vn at position i-qi = 0 and because you set ORIGIN=1 this is an invalid vector index.
Maybe this helps you finding the cause for the problem
EDIT: I tried in MC15 with the file of Ian Ward which I found here and it threw the same error at the same position. Maybe you can try contacting the author? According to dynamassist.com his mail address is(was?) IanWard@DynamAssist.com
You may also try to download the lastest version (for Prime 10 and above) of DynamAssist from that website mentioned before. It includes amongst others a file rainflow.mcdx which seems to include a modified version of the "range" function you are using. Maybe the bug is already fixed (I did not try as you can do that better yourself).
I sent mail to Mr. Ward, let see if he finds a solution.
Did you try his updated/modified version for Prime 10 at the DynamAssist webpage? The function "rainflow"included in the file rainflow.mcdx seems to do what the "range" you were using does, but with slightly changed input and output values.
I just noticed another thread dealing with reainflow counting here: https://community.ptc.com/t5/Mathcad/rainflow-cycle-counting/m-p/354062#M138266
There are other approaches posted there from other people (all in legacy Mathcad format) and at the end Mr. Ward posted his versions (which seems to be the version you converted to Prime). Looks like Mr. Ward was active here in the forum -> @ianward . Maybe he still is and is open for a PM from you in the forum system.
I tried the Prime 10 version and was able to get the "B" calculation to work. It's attached here.
Edit: I'm getting similar answers from my excel sheet for these examples so I think that it may work also 🙂
Great! So it seems that the author already fixed a bug or two.
