Package com.nr.fe

Examples of com.nr.fe.Levin


   

    // Test Levin
    System.out.println("Testing Levin");
    for (i=0;i<N;i++) {
      Levin sum =new Levin(M,eps);
      x=0.1*(i+1);
      partialsum=0.0;
      k=0;
      omega=1.0;
      while (!sum.cnvgd) {
        partialsum += omega;
        omega *= x;
        val=sum.next(partialsum,(k+beta)*omega);
      }
      y[i]=val;
      yy[i]=1.0/(1.0-x);
    }
    System.out.printf("Levin: Maximum discrepancy = %f\n", maxel(vecsub(y,yy)));
View Full Code Here


  }

  int main_levex(){
    int nterm=12;
    double beta=1.0,a=0.0,b=0.0,sum=0.0;
    Levin series = new Levin(100,0.0);
    //cout << setw(5) << "N" << setw(19) << "Sum (direct)" << setw(21)
    //  << "Sum (Levin)" << endl;
    for (int n=0; n<=nterm; n++) {
      b+=PI;
      double s=qromb(this,a,b,1.e-8);
      a=b;
      sum+=s;
      double omega=(beta+n)*s;
      double ans=series.next(sum,omega,beta);
      //cout << setw(5) << n << fixed << setprecision(14) << setw(21)
      //  << sum << setw(21) << ans << endl;
      System.out.printf("%f   %f\n", sum, ans);
    }
    return 0;
View Full Code Here

 
  public static void main(String[] args) {
    Levin_Ex le = new Levin_Ex();
    int nterm=12;
    double beta=1.0,a=0.0,b=0.0,sum=0.0;
    Levin series = new Levin(100,0.0);
   
    for (int n=0; n<=nterm; n++) {
      b+=Math.PI;
      double s=Trapzd.qromb(le,a,b,1.e-8);
      a=b;
      sum+=s;
      double omega=(beta+n)*s;
      double ans=series.next(sum,omega,beta);
      System.out.printf("%f %f\n", sum, ans);
    }
 
  }
View Full Code Here

TOP

Related Classes of com.nr.fe.Levin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.