//======================================================
// Numerical Analysis package in java
// example to show differential equation solution
// and differentiation (derivative) functions
// Dr. Turhan Coban
// =====================================================
import java.io.*;

class fm2 extends f_xi
{
//Van der Pol salınım deklemi
//kalp atış simulasyonu
 double mu=0.5;
 // d^2y/dt^2+mu(y^2-1)dy/dt=0
 double func(double x[],int x_ref)
 {
   //x[0] is x, x[1] is y
   if(x_ref==0) return x[2];
   else  return -x[1]-mu*(x[1]*x[1]-1.0)*x[2];
 }
}

public class diferansiyel3D
{


public static void main(String args[]) throws IOException
  {

  fm2 b1=new fm2();
  double y[];
  y=new double[3];
  y[0]=0.0;
  y[1]=0.0001;
  double a[][]=diferansiyel3.RK6(b1,0.0,100.0,y,10000);
  Plot p1=new Plot(a[1],a[2]);
  p1.setXlabel("y");
  p1.setYlabel("dy/dt");
  p1.setPlabel("van der Pol denklemi");
  p1.plot();
  Plot p2=new Plot(a[0],a[1]);
  p2.setXlabel("t");
  p2.setYlabel("y");
  p2.setPlabel("van der Pol denklemi");
  p2.plot();
 }
}

