struct Wheel {
Integrator v, y;
Wheel(Input
F,
double M,
double D,
double k):
v( (
F - D*v - k*y) / M ),
y( v ) {}
};
Wheel w(
F, 10, 500, 5e4);
Print(
"%6.3f %.4g %.4g\n", T.
Value(), w.y.Value(), w.v.Value());
}
Print(
"# wheel --- model of wheel+spring+damper\n");
}
virtual double Value()=0
get block output value this method should be defined in classes derived from aContiBlock
void SetAccuracy(double _abserr, double _relerr)
set max.
void SetStep(double _dtmin, double _dtmax)
Set integration step interval.
void SetOutput(const char *name)
redirects Output(), Print() to file
void Run()
run simulation experiment
int Print(const char *fmt,...)
for Output methods, can be redirected
void Init(double t0, double t1=SIMLIB_MAXTIME)
Initialize simulator and model time.
const SIMLIB_statistics_t & SIMLIB_statistics
interface to internal run-time statistics structure
Main SIMLIB/C++ interface.
void Output() const
print run-time statistics to output