Home > リソース > MBDynモデル集 > 14. File Driverデモ
MBDynモデル集

14. File Driverデモ

アニメーション



入力ファイル

filedriver_demo.mbd
# filedriver_demo.mbd

#-----------------------------------------------------------------------------
# [Data Block]

begin: data;
   problem: initial value;
end: data;

#-----------------------------------------------------------------------------
# [<Problem> Block]

begin: initial value;
   initial time:   0.;
   final time:     2.;
   time step:      1.e-2;
   max iterations: 10;
   tolerance:      1.e-6;
end: initial value;

#-----------------------------------------------------------------------------
# [Control Data Block]

begin: control data;
   structural nodes: 1;
   file drivers:     1;
   rigid bodies:     1;
   joints:           1;
end: control data;

#-----------------------------------------------------------------------------
# Node Labels
set: integer Node_Object = 1;

# Driver Labels
set: integer DrFile_Input =1;

# Body Labels
set: integer Body_Object = 1;

# Joint Labels
set: integer JoTotp_Object_Input = 1;

#-----------------------------------------------------------------------------
# [Nodes Block]

begin: nodes;

   #-----------------------------------------------------------------------------
   # Nodes
   structural: Node_Object, dynamic,
      null, # absolute position
      eye,  # absolute orientation
      null, # absolute velocity
      null; # absolute angular velocity
      
end: nodes;

#-----------------------------------------------------------------------------
# [Drivers Block]

begin: drivers;

   #-----------------------------------------------------------------------------
   # Drivers
   file: DrFile_Input,
      fixed step,
         count,
         2,    # columns number
         0,    # initial time
         0.01, # time step
         pad zeros, yes,
         "Input_Test.txt";
      
end: drivers;

#-----------------------------------------------------------------------------
# [Elements Block]

begin: elements;

   #-----------------------------------------------------------------------------
   # Bodies
   body: Body_Object, Node_Object,
      1.,   # mass
      null, # relative center of mass
      eye;  # inertia matrix
      
   #-----------------------------------------------------------------------------
   # Joints
   joint: JoTotp_Object_Input,
      total pin joint,
         Node_Object,
            position, null, # relative offset
            position, null, # absolute position
         position constraint,
            active, active, active,
            single, 1., 0., 0., 
               file, DrFile_Input,
                  2, # column number
         orientation constraint,
            active, active, active,
            null;
            
end: elements;

File Driverデータファイル

Input_Test.txt
  0.0000000e+000  0.0000000e+000
  1.0000000e-002  6.2790520e-002
  2.0000000e-002  1.2533323e-001
  3.0000000e-002  1.8738131e-001
  4.0000000e-002  2.4868989e-001
  5.0000000e-002  3.0901699e-001
  6.0000000e-002  3.6812455e-001
  7.0000000e-002  4.2577929e-001
  8.0000000e-002  4.8175367e-001
  9.0000000e-002  5.3582679e-001
  1.0000000e-001  5.8778525e-001
  1.1000000e-001  6.3742399e-001
  1.2000000e-001  6.8454711e-001
  1.3000000e-001  7.2896863e-001
  1.4000000e-001  7.7051324e-001
  1.5000000e-001  8.0901699e-001
  1.6000000e-001  8.4432793e-001
  1.7000000e-001  8.7630668e-001
  1.8000000e-001  9.0482705e-001
  1.9000000e-001  9.2977649e-001
  2.0000000e-001  9.5105652e-001
  2.1000000e-001  9.6858316e-001
  2.2000000e-001  9.8228725e-001
  2.3000000e-001  9.9211470e-001
  2.4000000e-001  9.9802673e-001
  2.5000000e-001  1.0000000e+000
  2.6000000e-001  9.9802673e-001
  2.7000000e-001  9.9211470e-001
  2.8000000e-001  9.8228725e-001
  2.9000000e-001  9.6858316e-001
  3.0000000e-001  9.5105652e-001
  3.1000000e-001  9.2977649e-001
  3.2000000e-001  9.0482705e-001
  3.3000000e-001  8.7630668e-001
  3.4000000e-001  8.4432793e-001
  3.5000000e-001  8.0901699e-001
  3.6000000e-001  7.7051324e-001
  3.7000000e-001  7.2896863e-001
  3.8000000e-001  6.8454711e-001
  3.9000000e-001  6.3742399e-001
  4.0000000e-001  5.8778525e-001
  4.1000000e-001  5.3582679e-001
  4.2000000e-001  4.8175367e-001
  4.3000000e-001  4.2577929e-001
  4.4000000e-001  3.6812455e-001
  4.5000000e-001  3.0901699e-001
  4.6000000e-001  2.4868989e-001
  4.7000000e-001  1.8738131e-001
  4.8000000e-001  1.2533323e-001
  4.9000000e-001  6.2790520e-002
  5.0000000e-001  1.2246468e-016
  5.1000000e-001 -6.2790520e-002
  5.2000000e-001 -1.2533323e-001
  5.3000000e-001 -1.8738131e-001
  5.4000000e-001 -2.4868989e-001
  5.5000000e-001 -3.0901699e-001
  5.6000000e-001 -3.6812455e-001
  5.7000000e-001 -4.2577929e-001
  5.8000000e-001 -4.8175367e-001
  5.9000000e-001 -5.3582679e-001
  6.0000000e-001 -5.8778525e-001
  6.1000000e-001 -6.3742399e-001
  6.2000000e-001 -6.8454711e-001
  6.3000000e-001 -7.2896863e-001
  6.4000000e-001 -7.7051324e-001
  6.5000000e-001 -8.0901699e-001
  6.6000000e-001 -8.4432793e-001
  6.7000000e-001 -8.7630668e-001
  6.8000000e-001 -9.0482705e-001
  6.9000000e-001 -9.2977649e-001
  7.0000000e-001 -9.5105652e-001
  7.1000000e-001 -9.6858316e-001
  7.2000000e-001 -9.8228725e-001
  7.3000000e-001 -9.9211470e-001
  7.4000000e-001 -9.9802673e-001
  7.5000000e-001 -1.0000000e+000
  7.6000000e-001 -9.9802673e-001
  7.7000000e-001 -9.9211470e-001
  7.8000000e-001 -9.8228725e-001
  7.9000000e-001 -9.6858316e-001
  8.0000000e-001 -9.5105652e-001
  8.1000000e-001 -9.2977649e-001
  8.2000000e-001 -9.0482705e-001
  8.3000000e-001 -8.7630668e-001
  8.4000000e-001 -8.4432793e-001
  8.5000000e-001 -8.0901699e-001
  8.6000000e-001 -7.7051324e-001
  8.7000000e-001 -7.2896863e-001
  8.8000000e-001 -6.8454711e-001
  8.9000000e-001 -6.3742399e-001
  9.0000000e-001 -5.8778525e-001
  9.1000000e-001 -5.3582679e-001
  9.2000000e-001 -4.8175367e-001
  9.3000000e-001 -4.2577929e-001
  9.4000000e-001 -3.6812455e-001
  9.5000000e-001 -3.0901699e-001
  9.6000000e-001 -2.4868989e-001
  9.7000000e-001 -1.8738131e-001
  9.8000000e-001 -1.2533323e-001
  9.9000000e-001 -6.2790520e-002
  1.0000000e+000 -2.4492936e-016
  1.0100000e+000  6.2790520e-002
  1.0200000e+000  1.2533323e-001
  1.0300000e+000  1.8738131e-001
  1.0400000e+000  2.4868989e-001
  1.0500000e+000  3.0901699e-001
  1.0600000e+000  3.6812455e-001
  1.0700000e+000  4.2577929e-001
  1.0800000e+000  4.8175367e-001
  1.0900000e+000  5.3582679e-001
  1.1000000e+000  5.8778525e-001
  1.1100000e+000  6.3742399e-001
  1.1200000e+000  6.8454711e-001
  1.1300000e+000  7.2896863e-001
  1.1400000e+000  7.7051324e-001
  1.1500000e+000  8.0901699e-001
  1.1600000e+000  8.4432793e-001
  1.1700000e+000  8.7630668e-001
  1.1800000e+000  9.0482705e-001
  1.1900000e+000  9.2977649e-001
  1.2000000e+000  9.5105652e-001
  1.2100000e+000  9.6858316e-001
  1.2200000e+000  9.8228725e-001
  1.2300000e+000  9.9211470e-001
  1.2400000e+000  9.9802673e-001
  1.2500000e+000  1.0000000e+000
  1.2600000e+000  9.9802673e-001
  1.2700000e+000  9.9211470e-001
  1.2800000e+000  9.8228725e-001
  1.2900000e+000  9.6858316e-001
  1.3000000e+000  9.5105652e-001
  1.3100000e+000  9.2977649e-001
  1.3200000e+000  9.0482705e-001
  1.3300000e+000  8.7630668e-001
  1.3400000e+000  8.4432793e-001
  1.3500000e+000  8.0901699e-001
  1.3600000e+000  7.7051324e-001
  1.3700000e+000  7.2896863e-001
  1.3800000e+000  6.8454711e-001
  1.3900000e+000  6.3742399e-001
  1.4000000e+000  5.8778525e-001
  1.4100000e+000  5.3582679e-001
  1.4200000e+000  4.8175367e-001
  1.4300000e+000  4.2577929e-001
  1.4400000e+000  3.6812455e-001
  1.4500000e+000  3.0901699e-001
  1.4600000e+000  2.4868989e-001
  1.4700000e+000  1.8738131e-001
  1.4800000e+000  1.2533323e-001
  1.4900000e+000  6.2790520e-002
  1.5000000e+000  3.6739404e-016
  1.5100000e+000 -6.2790520e-002
  1.5200000e+000 -1.2533323e-001
  1.5300000e+000 -1.8738131e-001
  1.5400000e+000 -2.4868989e-001
  1.5500000e+000 -3.0901699e-001
  1.5600000e+000 -3.6812455e-001
  1.5700000e+000 -4.2577929e-001
  1.5800000e+000 -4.8175367e-001
  1.5900000e+000 -5.3582679e-001
  1.6000000e+000 -5.8778525e-001
  1.6100000e+000 -6.3742399e-001
  1.6200000e+000 -6.8454711e-001
  1.6300000e+000 -7.2896863e-001
  1.6400000e+000 -7.7051324e-001
  1.6500000e+000 -8.0901699e-001
  1.6600000e+000 -8.4432793e-001
  1.6700000e+000 -8.7630668e-001
  1.6800000e+000 -9.0482705e-001
  1.6900000e+000 -9.2977649e-001
  1.7000000e+000 -9.5105652e-001
  1.7100000e+000 -9.6858316e-001
  1.7200000e+000 -9.8228725e-001
  1.7300000e+000 -9.9211470e-001
  1.7400000e+000 -9.9802673e-001
  1.7500000e+000 -1.0000000e+000
  1.7600000e+000 -9.9802673e-001
  1.7700000e+000 -9.9211470e-001
  1.7800000e+000 -9.8228725e-001
  1.7900000e+000 -9.6858316e-001
  1.8000000e+000 -9.5105652e-001
  1.8100000e+000 -9.2977649e-001
  1.8200000e+000 -9.0482705e-001
  1.8300000e+000 -8.7630668e-001
  1.8400000e+000 -8.4432793e-001
  1.8500000e+000 -8.0901699e-001
  1.8600000e+000 -7.7051324e-001
  1.8700000e+000 -7.2896863e-001
  1.8800000e+000 -6.8454711e-001
  1.8900000e+000 -6.3742399e-001
  1.9000000e+000 -5.8778525e-001
  1.9100000e+000 -5.3582679e-001
  1.9200000e+000 -4.8175367e-001
  1.9300000e+000 -4.2577929e-001
  1.9400000e+000 -3.6812455e-001
  1.9500000e+000 -3.0901699e-001
  1.9600000e+000 -2.4868989e-001
  1.9700000e+000 -1.8738131e-001
  1.9800000e+000 -1.2533323e-001
  1.9900000e+000 -6.2790520e-002
  2.0000000e+000 -4.8985872e-016