3import umontreal.ssj.simevents.*;
6 double r = 0.005, c = 0.00001, s = 0.01, d = 0.000005, h = 5.0;
7 double x0 = 2000.0, z0 = 150.0;
8 double horizon = 501.0;
13 public static void main(String[] args) {
23 (sim.continuousState()).selectRungeKutta4(h);
35 return (r *
value() - c *
value() * z.value());
45 return (-s *
value() + d * x.value() * value());
49 class PrintPoint
extends Event {
55 System.out.println(sim.time() +
" " + x.value() +
" " + z.value());
void actions()
This is the method that is executed when this event occurs.
double derivative(double t)
This method should return the derivative of this variable with respect to time, at time .
double derivative(double t)
This method should return the derivative of this variable with respect to time, at time .
void actions()
This is the method that is executed when this event occurs.
Represents a variable in a continuous-time simulation.
Continuous()
Constructs a new continuous-time variable linked to the default simulator, without initializing it.
double value()
Returns the current value of this continuous-time variable.
Event()
Constructs a new event instance, which can be placed afterwards into the event list of the default si...
void schedule(double delay)
Schedules this event to happen in delay time units, i.e., at time sim.time() + delay,...
Represents the executive of a discrete-event simulator.