Why do you want to do this inside Adams? This is a post/pre-processing step, right?
So do this in Excel, save the resulting data in a csv file and import into View as a spline.
If you want to do it in Adams, it is not hard to do in pre/post processing step. Easiest and fastest is to switch to Python, but can be done in cmd as well.
Here is the syntax for a loop in cmd.
for var=ii start=1 end=1999
var set var=jj int=(eval(int(ii))) !! the loop variable is a real and you want to index using integers
.
.
.
end
If you want to do it during run-time, it is much more complicated. A subroutine is recommended for that.
Here you will see 3 measurements (Origin_Z , Relative_Y and Relative_Z).
After running the model with the following setup : End Time = 2.0 and Steps = 2000, you can plot the displacement of Relative_Y based on Origin_Z and Relative_Z based on Origin_Z (see the picture attached).
Can you please try your solution and give me afterwards the new .cmd ?
You can't create this inside the model. It has to be a macro or command file that you execute (read in) after the analysis is done. This code creates a new view variables with all the values you are asking for.
var set var=new_values real=0.0
for var=ii start=1 end=(eval(COLS(.sample.Last_Run.Relative_Y.Q)-1))