#include<stdio.h>
#include<math.h>
void DOUT();
double E1();
double F1();
double L1(double Z);
double L2(double Z);
double L3(double Z);
double R1(double J,double Z);
double R2(double J,double Z);
double R3(double J,double Z);
double R4(double J,double Z);
double C1(double Z);
double C2(double Z);
double C3(double Z);
double R5(double J,double Z);
double R6(double J,double Z);
void FUNC(double T,double X[],int N);
double FU(int I,double T,double X[]);
double OP[100];
double H,X[130],XX[30],T;
double PA[10000];
double DX[130];
double DSIGN(double a,double b);


void DOUT(){
  OP[0]=X[6];
  OP[1]=X[7];
  OP[2]=X[8];
}

double E1(){
  double E1;
if(T<=0.1){
   E1=PA[1];
}else{
   E1=PA[2];
}
  return(E1);
}

double F1(){
  double F1;
F1=PA[3];
  return(F1);
}

double L1(double Z){
  double L1;
L1=Z/PA[4];
  return(L1);
}

double L2(double Z){
  double L2;
L2=Z/PA[5];
  return(L2);
}

double L3(double Z){
  double L3;
L3=Z/PA[6];
  return(L3);
}

double R1(double J,double Z){
  double R1;
R1=PA[7]*Z;
  return(R1);
}

double R2(double J,double Z){
  double R2;
R2=PA[8]*Z;
  return(R2);
}

double R3(double J,double Z){
  double R3;
R3=PA[9]*Z;
  return(R3);
}

double R4(double J,double Z){
  double R4;
R4=PA[10]*Z;
  return(R4);
}

double C1(double Z){
  double C1;
C1=PA[11]*Z;
  return(C1);
}

double C2(double Z){
  double C2;
C2=PA[12]*Z;
  return(C2);
}

double C3(double Z){
  double C3;
C3=PA[13]*Z;
  return(C3);
}

double R5(double J,double Z){
  double R5;
R5=PA[14]*Z;
  return(R5);
}

double R6(double J,double Z){
  double R6;
R6=PA[15]*Z;
  return(R6);
}

void FUNC(double T,double X[],int N){
  DX[0]=(E1()-C1(X[3])-R2(0,(L1(X[0])-L2(X[1])))-R1(0,L1(X[0])));
  DX[1]=(C1(X[3])-C2(X[4])-R4(0,(L2(X[1])-L3(X[2])))-R3(0,L2(X[1]))+R2(0,(L1(X[0])-L2(X[1]))));
  DX[2]=(C2(X[4])-C3(X[5])-R6(0,(L3(X[2])-F1()))-R5(0,L3(X[2]))+R4(0,(L2(X[1])-L3(X[2]))));
  DX[3]=(-L2(X[1])+L1(X[0]));
  DX[4]=(-L3(X[2])+L2(X[1]));
  DX[5]=(-F1()+L3(X[2]));
  DX[6]=L1(X[0]);
  DX[7]=L2(X[1]);
  DX[8]=L3(X[2]);
}

double FU(int I,double T,double X[]){
  double FU;
  FU=0.0e-00;
  return(FU);
}

