Example usage for org.apache.commons.math.complex Complex I

List of usage examples for org.apache.commons.math.complex Complex I

Introduction

In this page you can find the example usage for org.apache.commons.math.complex Complex I.

Prototype

Complex I

To view the source code for org.apache.commons.math.complex Complex I.

Click Source Link

Document

The square root of -1.

Usage

From source file:com.QMTunnelling.GaussianPotential.java

public Complex getA() {//finds A coef
    Complex psi1 = this.psi[0];
    Complex psi2 = this.psi[1];
    double x1 = this.xvals[0];
    double x2 = this.xvals[1];

    Complex A = (psi2.multiply(Exp(Complex.I.multiply(Math.sqrt(kappa) * x2))));
    A = A.subtract(psi1.multiply(Exp(Complex.I.multiply(Math.sqrt(kappa) * x1))));
    Complex divisor = Exp(Complex.I.multiply(2 * Math.sqrt(kappa) * x2))
            .subtract(Exp(Complex.I.multiply(2 * Math.sqrt(kappa) * x1)));
    A = A.divide(divisor);/*w w  w. j  ava  2s . com*/
    return A;
}

From source file:com.QMTunnelling.GaussianPotential.java

public void initValues() { //set two initial values for euler integrator
    this.psi[2 * NMAX - 1] = Exp(Complex.I.multiply(Math.sqrt(kappa) * NMAX * DXI)); //Initial value at NMAX*DXI
    this.psi[2 * NMAX - 2] = Exp(Complex.I.multiply(Math.sqrt(kappa) * (NMAX - 1) * DXI));
}