/* Class ExampleProgramOneISS Example Program for class ImpedSpecImpedance Model circuit chosen from one of the range of precompiled models Michael Thomas Flanagan (http:\\www.ee.ucl.ac\~flanaga\java) May 2007 */ import java.util.Vector; import flanagan.complex.Complex; import flanagan.circuits.*; public class ExampleProgramOneISS{ public static void main(String[] args){ // Create an instance of ImpedSpecSimulation ImpedSpecSimulation iss = new ImpedSpecSimulation("Example Program One"); double[] parameters = {3.0e4, 5.0e-8, 5.0e4, 0.3, 1.0e3}; // parameter values iss.setAppliedVoltage(1.0D); // enter the applied voltage (1 V) iss.setReferenceImpedance(1.0e5); // enter the reference impedance (100000 ohms) iss.setModel(26, parameters); // enter the circuit model number 26 iss.setScanRangeHz(0.1, 1e10); // enter the frequency range Vector results = iss.getSimulationResults(50); // get all the simulation data for 50 points iss.plotVoltageMagnitudes(); // plot the test circuit voltage magnitude against frequency iss.plotVoltagePhases(); // plot the test circuit voltage phase against frequency iss.plotImpedanceMagnitudes(); // plot the test circuit impedance magnitude against frequency iss.plotImpedancePhases(); // plot the test circuit impedance phase against frequency iss.plotColeCole(); // plot the Cole-Cole plot (Imag[z] against Real[z] iss.print("ExampleOne.txt",20); // print the results for 20 points to a text file iss.printForExcel("ExampleOne.xls",20); // print the results for 20 points to an Excel file } }