import javax.swing.*;
public class HT_infinite_wall
{      
        public static double[][] T(double Ts,double Ti,double alfa,double t)
        {   int n=100;
	        double a[][]=new double[2][n];
	        
          for(int i=0;i<n;i++)
          {a[0][i]=(double)i/100.0;
	       a[1][i]=Ts+(Ti-Ts)*Mathd.erf(a[0][i]/Math.sqrt(4.0*alfa*t));
	       System.out.println("x="+a[0][i]+"y="+a[1][i]);
	      }
	      return a;
        }
        public static void main(String arg[])
        {
	    double alfa=Double.parseDouble(JOptionPane.showInputDialog("alfa = "));
	    double t=Double.parseDouble(JOptionPane.showInputDialog("t (second) = ")); 
	    double Ts=Double.parseDouble(JOptionPane.showInputDialog("surface temp Ts C  = "));
	    double Ti=Double.parseDouble(JOptionPane.showInputDialog("initial temp Ti C  = "));
	    double a[][]=T(Ts,Ti,alfa,t);
	    Plot p=new Plot(a[0],a[1]); 
	    p.plot();  
	    }
}