hexagon logo

Spline with formula behind

Hello everyone,
 
 
My model, developed with ADAMS View, has a marker called "Origin" with coordinates {0.0, 0.0, 0.0} and a second marker called "Relative".
 
I am using 2 measurements in order to plot the displacement of Relative on Y direction, but related to the Origin.
Also the displacement of Relative on Z direction, but related to the same Origin.
 
Both 2D splines have approx. 2000 points on each column.
 
I want to generate a 3rd spline by using the data from previous measurements.
This new spline will have a formula behind :
 
 
Relative.Y (1st point) - Relative.Y (2nd point) + Relative.Z (1st point) - Relative.Z (2nd point)
 
then,
 
Relative.Y (2nd point) - Relative.Y (3rd point) + Relative.Z (2nd point) - Relative.Z (3rd point)
 
then,
 
Relative.Y (3rd point) - Relative.Y (4thd point) + Relative.Z (3rd point) - Relative.Z (4thd point)
 
and so on until
 
Relative.Y (1999th point) - Relative.Y (2000th point) + Relative.Z (1999th point) - Relative.Z (2000th point)
 
 
In Excel I could do that very easy, but now I want to generate this in ADAMS either.
 
I would prefer to have a simple equation, instead of 2000 equations Joy ... I do not know... something with while loop... I guess....
 
Can you please give me some recommendations how to write this formula ?
 
Many thanks! Regards,
Daniel
Parents
  • 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.
Reply
  • 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.
Children
No Data