
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;

public class Disperse extends DisperseGUI{

  void solve(){
    FT.Transform();
    for (int i = 0; i <= N2 ; i++){
       ficos[i] = FT.fcos[i];
       fisin[i] = FT.fsin[i];
    }
    t = 0;
    while(true) {
      t += tstep;
      for (int i = 1; i <= N2 ; i++){
	double wt = omega(i) * t;
	FT.fcos[i] = 0.0;
        FT.fsin[i] = 0.0;
	    /* replace this with code that solves the wave equation */
      }
      FT.InverseTransform();
      refreshPicture();
      if (timetostop) break;
    }
  }

  double omega(int n){
      double w;
      double k =  2.0 * Math.PI * n/Nx;
      w = k;
          /* replace this with your favorite dispersion relation */
      return w;
  }

  void inputWave(){
    for (int n = 0 ; n < Nx; n++){
       double t = (n- 0.2*Nx)/(0.2*Nx);
       fi[n] = Math.exp(- 10.0 * t * t) * Math.sin(24.0* Math.PI * t);
    }
  }

}
