Vdpol.java
01 /*
02  * $Id: Vdpol.java,v 1.12 2008/06/26 10:10:34 koga Exp $
03  *
04  * Copyright (C) 2004 Koga Laboratory. All rights reserved.
05  *
06  */
07 package matxbook.chap21;
08 
09 import org.mklab.nfc.matrix.DoubleMatrix;
10 import org.mklab.nfc.matrix.Matrix;
11 import org.mklab.nfc.ode.DifferentialEquation;
12 
13 
14 /**
15  * ヴァンデルポール方程式を表すクラスです。
16  
17  @author koga
18  @version $Revision: 1.12 $, 2004/04/22
19  */
20 public class Vdpol implements DifferentialEquation {
21 
22   /**
23    @see org.mklab.nfc.ode.DifferentialEquation#differentialEquation(double, org.mklab.nfc.matrix.Matrix)
24    */
25   @SuppressWarnings("unused"
26   public Matrix differentialEquation(double t, Matrix X) {
27     double x1 = ((DoubleMatrix)X).getDoubleElement(1);
28     double x2 = ((DoubleMatrix)X).getDoubleElement(2);
29     Matrix dx = new DoubleMatrix(new double[][] { {x1 * (- x2 * x2- x2}{x1}});
30     return dx;
31   }
32 }