1
2
3
4
5
6
7
8
9
10 package nl.tudelft.simulation.jstats.ode;
11
12
13 /***
14 * <p>
15 * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
16 * University of Technology </a>, the Netherlands. <br>
17 * See for project information <a
18 * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
19 * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
20 * License (GPL) </a>, no warranty <br>
21 *
22 * @author <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm">Peter
23 * Jacobs </a>
24 * @version 1.2 Apr 20, 2004
25 * @since 1.4
26 */
27 public class Function extends DifferentialEquation
28 {
29 /***
30 * constructs a new Function
31 *
32 * @param stepSize the stepSize
33 * @param integrationMethod the methodOfIntegration
34 */
35 public Function(final double stepSize, final short integrationMethod)
36 {
37 super(stepSize, integrationMethod);
38 super.initialize(0, new double[]{0.5, 1.5});
39 }
40
41 /***
42 * @see nl.tudelft.simulation.jstats.ode.DifferentialEquationInterface#dy(double,
43 * double[])
44 */
45 public double[] dy(final double x, final double[] y)
46 {
47 return new double[]{y[1], -0.2 * y[1] - Math.sin(y[0])};
48 }
49 }