
import statement: 
import flanagan.circuits.ImpedSpecRegression; import flanagan.circuits.ImpedSpecRegressionFunction1; (only for precompiled model circuits) import flanagan.circuits.ImpedSpecRegressionFunction2; (only for user supplied circuits) import flanagan.circuits.ImpedSpecModel; (only for user supplied circuits) 
Constructors  public ImpedSpecRegression()  
public ImpedSpecRegression(String title)  
Enter the circuit model  Choose a listed circuit model  public void setModel(int modelNumber) 
public void setModel(int modelNumber, double[ ] initialEstimates)  
public void setModel(int modelNumber, double[ ] initialEstimates, double[ ] initialSteps)  
Enter a user coded circuit model  public void setModel(ImpedSpecModel userModel, String[ ] symbols, double[ ] initialEstimates)  
public void setModel(ImpedSpecModel userModel, String[ ] symbols, double[ ] initialEstimates, double[ ] initialSteps)  
Get circuit model details  public double[] getInitialEstimates()  
public String[] getCircuitComponents()  
Enter the experimental data  Enter the reference impedance  public void setReferenceImpedance(double resistance) 
public void setReferenceImpedance(double referenceRealZ, double referenceImagZ)  
public void setReferenceImpedance(Complex referenceImpedance)  
Enter the applied voltage  public void setAppliedVoltage(double appliedVoltage)  
public void setAppliedVoltage(double appliedVoltage, double appliedVoltageError)  
Enter the experimental data as voltage  public void voltageDataAsPhasorRad(double[] frequencies, double[] voltageMagnitudes, double[] voltagePhasesRad)  
public void voltageDataAsPhasorRad(double[] frequencies, double[] voltageMagnitudes,double[] voltagePhasesRad, double[] voltageMagWeights, double[] voltagePhaseWeights)  
public void voltageDataAsPhasorDeg(double[] frequencies, double[] voltageMagnitudes,double[] voltagePhasesDeg)  
public void voltageDataAsPhasorDeg(double[] frequencies, double[] voltageMagnitudes,double[] voltagePhasesDeg, double[] voltageMagWeights, double[] voltagePhaseWeights)  
public void voltageDataAsComplex(double[] frequencies, double[] real,double[] imag)  
public void voltageDataAsComplex(double[] frequencies, double[] real,double[] imag, double[] realWeights, double[] imagWeights)  
public void voltageDataAsComplex(double[] frequencies, Complex[] voltages)  
public void voltageDataAsComplex(double[] frequencies, Complex[] voltages, Complex[] voltageWeights)  
Enter the experimental data as impedance  public void impedanceDataAsPhasorRad(double[] frequencies, double[] impedanceMagnitudes, double[] impedancePhasesRad)  
public void impedanceDataAsPhasorRad(double[] frequencies, double[] impedanceMagnitudes,double[] impedancePhasesRad, double[] impedanceMagWeights, double[] impedancePhaseWeights)  
public void impedanceDataAsPhasorDeg(double[] frequencies, double[] impedanceMagnitudes,double[] impedancePhasesDeg)  
public void impedanceDataAsPhasorDeg(double[] frequencies, double[] impedanceMagnitudes,double[] impedancePhasesDeg, double[] impedanceMagWeights, double[] impedancePhaseWeights)  
public void impedanceDataAsComplex(double[] frequencies, double[] real,double[] imag)  
public void impedanceDataAsComplex(double[] frequencies, double[] real,double[] imag, double[] realWeights, double[] imagWeights)  
public void impedanceDataAsComplex(double[] frequencies, Complex[] impedances)  
public void impedanceDataAsComplex(double[] frequencies, Complex[] impedances, Complex[] impedanceWeights)  
Regression procedure  
Change the regression constraints  public void addNewConstraint(int parameterNumber, int direction, double boundary)  
public void addNewConstraint(String parameterSymbol, int direction, double boundary)  
public void removeDefaultConstraints()  
public void removeAddedConstraints()  
public void removeAllConstraints()  
public void restoreDefaultConstraints()  
Change the regression termination tolerance  public void resetTolerance(double tolerance)  
Change the maximum number of regression iterations allowed  public void resetMaximumNumberOfIterations(int maximum)  
Return all the results of the regression  public Vector<Object> getRegressionResults()  
Get the best estimate values  public double[] getBestEstimates()  
public double[] getStandardDeviations()  
Plot the results  Set frequency axis plot option  public void setLog10Plot() 
public void setLinearPlot()  
Plot the impedance spectra  public Vector<Object> plotColeCole()  
public Vector<Object> plotImpedanceMagnitudes()  
public Vector<Object> plotImpedancePhases()  
Plot the voltage spectra  public Vector<Object> plotVoltageMagnitudes()  
public Vector<Object> plotVoltagePhases()  
Write results to a file  Write results to a text file  public Vector<Object> printToTextFile(String fileName) 
public Vector<Object> printToTextFile()  
Write results to an Excel readable file  public Vector<Object> printToExcelFile(String fileName)  
public Vector<Object> printToExcelFile() 
Resistor impedance  public static Complex resistanceImpedance(double resistorValue) 
Capacitor impedance  public static Complex capacitanceImpedance(double capacitorValue, double omega) 
Inductor impedance  public static Complex inductanceImpedance(double inductorValue, double omega) 
'Infinite' Warburg impedance  public static Complex infiniteWarburgImpedance(double sigma, double omega) 
'Finite' Warburg impedance  public static Complex finiteWarburgImpedance(double sigma, double delta, double omega) 
Constant phase element impedance  public static Complex constantPhaseElementImpedance(double sigma, double alpha, double omega) 
Precompiled model circuit impedance  public static Complex modelImpedance(double[] parameters, double omega, int modelNumber) 
Impedances in series  public static Complex impedanceInSeries(Complex impedance1, Complex impedance2) 
public static Complex impedanceInSeries(double impedance1, Complex impedance2)  
public static Complex impedanceInSeries(Complex impedance1, double impedance2)  
public static Complex impedanceInSeries(double impedance1, double impedance2)  
public static Complex rInSeriesWithC(double resistorValue, double capacitorValue, double omega)  
public static Complex rInSeriesWithL(double resistorValue, double inductorValue, double omega)  
public static Complex cInSeriesWithL(double capacitorValue, double inductorValue, double omega)  
Impedances in parallel  public static Complex impedanceInParallel(Complex impedance1, Complex impedance2) 
public static Complex impedanceInParallel(double impedance1, Complex impedance2)  
public static Complex impedanceInParallel(Complex impedance1, double impedance2)  
public static Complex impedanceInParallel(double impedance1, double impedance2)  
public static Complex rInParallelWithC(double resistorValue, double capacitorValue, double omega)  
public static Complex rInParallelWithL(double resistorValue, double inductorValue, double omega)  
public static Complex cInParallelWithL(double capacitorValue, double inductorValue, double omega)  
List of precompiled model circuit components  public static String[ ] modelComponents(int modelNumber) 
Warburg coefficient, σ  public static double warburgSigma(double electrodeArea, double oxidantDiffCoeff, double reductantDiffCoeff, double oxidantConcn, double reductantConcn, int electronsTransferred) 
Parallel plate capacitance  public static double parallelPlateCapacitance(double plateArea, double plateSeparation, double relativePermittivity) 
public static double parallelPlateCapacitance(double plateLength, double plateWidth, double plateSeparation, double relativePermittivity)  
Coaxial cylinders  capacitance  public static double coaxialCapacitance(double cylinderLength, double innerRadius, double outerRadius, double relativePermittivity) 
Parallel wires  capacitance  public static double parallelWiresCapacitance(double wireLength, double wireRadius, double wireSeparation, double relativePermittivity) 
Parallel plates  inductance 
public static double parallelPlateInductance(double plateLength, double plateWidth, double plateSeparation, double relativePermeability) 
Coaxial cylinders  inductance  public static double coaxialInductance(double cylinderLength, double innerRadius, double outerRadius, double relativePermbeability) 
Parallel wires  inductance  public static double parallelWiresInductance(double wireLength, double wireRadius, double wireSeparation, double relativePermbeability) 
Magnitudes and phases  public static double getMagnitude(Complex variable) 
public static double getPhaseRad(Complex variable)  
public static double getPhaseDeg(Complex variable)  
Conversions  public static Complex polarRad(double magnitude, double phaseRad) 
public static Complex polarDeg(double magnitude, double phaseDeg)  
public static double frequencyToRadialFrequency(double frequency)  
public static double radialFrequencyToFrequency(double radial) 
element 0:  number of of data points, n, i.e. number of frequencies  [as an Integer] 
element 1:  number of parameters in the model, p  [as an Integer] 
element 2:  degrees of freedom, ν, i.e. n − p  [as an Integer] 
element 3:  circuit parameter symbols  [as an array of Strings] 
element 4:  initial estimates  [as an array of doubles] 
element 5:  initial step sizes  [as an array of doubles] 
element 6:  best estimates returned by the regression procedure  [as an array of doubles] 
element 7:  standard deviations of the best estimate. See Standard deviations (below) for a note of caution on interpreting these estimated standard deviations  [as an array of doubles] 
element 8:  coefficients of variation of the best estimates, i.e. (100 x standard deviation) / (best estimate)  [as an array of doubles] 
element 9:  correlation coefficients of the best estimates  [as a two dimensional array of doubles] 
element 10:  the gradients on the regression surface immediately before the minimum calculated numerically for each parameter  [as an array of doubles] 
element 11:  the gradients on the regression surface immediately after the minimum calculated numerically for each parameter  [as an array of doubles] 
element 12:  sum of squares of the residuals  [as a Double] 
element 13:  reduced sum of squares of the residuals, i.e. (sum of squares of the residuals)/(degrees of freedom)  [as a Double] 
element 14:  chiSquare, i.e. sum of the squares of the weighted residual  [as a Double if weights were provided, null if no weights] 
element 15:  reduced chiSquare  [as a Double if weights were provided, null if no weights] 
element 16:  number of iterations taken by the regression procedure  [as an Integer] 
element 17:  maximum number of iterations allowed  [as an Integer] 
element 18:  mode of data entry, e.g. as real and imaginary parts of the impedance  [as a String] 
element 19:  frequencies (Hz)  [as an array of doubles] 
element 20:  log_{10}[frequencies/Hz]  [as an array of doubles] 
element 21:  radial frequencies  [as an array of doubles] 
element 22:  log_{10}[[radial frequencies]  [as an array of doubles] 
element 23:  experimental voltage magnitudes  [as an array of doubles] 
element 24:  experimental voltage phases as radians  [as an array of doubles] 
element 25:  experimental voltage phases as degrees  [as an array of doubles] 
element 26:  experimental complex voltages  [as an array of Complex] 
element 27:  real parts of the experimental voltages  [as an array of doubles] 
element 28:  imaginary parts of the experimental voltages  [as an array of doubles] 
element 29:  real parts of the experimental impedances  [as an array of doubles] 
element 30:  imaginary parts of the experimental impedances  [as an array of doubles] 
element 31:  calculated values of the real part of the impedances  [as an array of doubles] 
element 32:  calculated values of the imaginary part of the impedances  [as an array of doubles] 
element 33:  Real[impedance] residuals, i.e. experimental Real[impedance]  calculated Real[impedance]  [as an array of doubles] 
element 34:  Imag[impedance] residuals, i.e. experimental Imag[impedance]  calculated Imag[impedance]  [as an array of doubles] 
element 35:  entered weights for the first data array, ie. for Real[impedance], complex impedance or magnitude  [as an array of doubles if weights were provided, null if no weights ] 
element 36:  entered weights for the second data array, ie. for Imag[impedance] or phase, null if impedance was entered as a Complex  [as an array of doubles if weights were provided, null if no weights ] 
element 37:  weights used in the regression for Real[impedance], if weights have been entered if the weights were not entered as Real[impedance] weights, the used Real[impedance] weights were calculated using the ErrorProp and ComplexErrorProp error propagation classes  [as an array of doubles if weights were provided, null if no weights ] 
element 38:  weights used in the regression for Imag[impedance], if weights have been entered if the weights were not entered as Imag[impedance] weights, the used Imag[impedance] weights were calculated using the ErrorProp and ComplexErrorProp error propagation classes  [as an array of doubles if weights were provided, null if no weights ] 
element 39:  calculated impedances  [as an array of Complex ] 
element 40:  real parts of the calculated voltages  [as an array of doubles ] 
element 41:  imaginary parts of the calculated voltages  [as an array of doubles ] 
element 42:  calculated voltages  [as an array of Complex ] 
element 43:  magnitudes of the calculated voltages  [as an array of doubles ] 
element 44:  phases (as radians) of the calculated voltages  [as an array of doubles ] 
element 45:  phases (as degrees) of the calculated voltages  [as an array of doubles ] 