Installation
Running the program from the command line (testing)
Description of the simulation
The input files
The output files
Running simulations using Python
These Pages are yet to be adapted for PHIsim_v3
The simulator program is a development from an amplifier simulation program. It has some quirks which hopefully don't put you off. You will need to install a few programs and set up a few files which is some work but once you have done that it is not to bad.
The first thing to do is to install two programs: PHIsim_v3 and PHIsim_inputv3.
Download the distribution kits for these two programs from the installation page:
PHIsim_input
PHIsim_v3
Detail: The downloads are LabWindows/CVI generated distribution packages (180Mb approximately each).
For each of the two programs: Unzip the download files to a directory of your choice. Install each program by double clicking the setup.exe program in the directory where the unzipped files are located. The order of installation does not matter.
The programs are .exe files installed in folders that are in the 'Program Files' folder so typically in 'C:\Program Files\PHIsim_v3\' and 'C:\Program Files\PHIsim_inputv3\' . Both programs do not have a user interface but use a number text files (.txt) for input and output. The programs can be run from the command line in a command window by typing the program name PHIsim_v3.exe or PHIsim_inputv3.exe followed by the proper arguments specifying the input files. Alternatively you can run the programs from some scripting language or .bat file or other tools that allow you to run external programs. First we will discuss running the program form the command line and then we will describe the use from the Python scripting language and MatLAB/Octave.
Whichever way you want to use the programs, the operating system will have to know where to find the programs.
Create a new folder where we will store the input and output files for the simulation. In this tutorial the folder is named C:\simulation. Obviously you can pick a more suitable name and location of the folder.
Copy or move the PHIsim_v3.exe or PHIsim_inputv3.exe files from the Program Files subfolders to the folder where all input and output files will be. In this tutorial it will be assumed that the simulation will be run in the folder: C:\simulation . Therefore if you want to run the simulations from another directory use that folder name use that instead of C:\simulation .
Or (more conveniently) you can add the location of the PHIsim_v3.exe or PHIsim_inputv3.exe files to the PATH environment variable. There are many websites that describe how to do this. This is just one of them.
Start the Command Prompt in Windows. This can be done by in Windows 7 by typing cmd in the Start Menu; in Windows 10 by clicking on the Search Windows icon in the task bar and typing command and the application will appear in the search results. Detail: The program command prompt is in the Windows Accessories group.
In the command prompt window type the command: cd c:\simulation to go to the folder where the simulation is to be run.
Then as a test type: PHIsim_inputv3.exe (followed by enter).
For a number of seconds a separate window will appear with an error message. The program complains that no or an insufficient number of input files are specified. PHIsim_inputv3.exe expects three or four input files as arguments behind the command. One of these input files can be generated by the program PHIsim_inputv3.exe. PHIsim_inputv3.exe needs two input files as arguments. Detail: The program does not respond like a normal command. It is a LabWindows-CVI console application.
We can do a quick test run of the two programs.
open a Windows Explorer to look at the content of the folder C:\simulation
download four input files from this site using these four links: PHIsimv3_pars_InGaAsP_ridge.txt, carrierfile.txt, photondfile.txt, device_input_Fabry_Perot_laser.txt
Copy or directly save the files PHIsimv3_pars_InGaAsP_ridge.txt, carrierfile.txt, photondfile.txt and device_input_Fabry_Perot_laser.txt to the folder C:\simulation. You can use the normal windows explorer of course for copying or moving.
The program PHIsim_input.exe needs two input files: 1) PHIsim_input_pars.txt which contains a large number of parameters for the simulation which we will discuss in the next section in detail; 2) device_input_Fabry_Perot_laser.txt which contains a description of the device we want to simulate (a Fabry-Perot laser in this case), again we will discuss this in detail later on.
At the command prompt type: PHIsim_inputv3.exe PHIsimv3_pars_InGaAsP_ridge.txt device_input_Fabry-Perot_laser.txt
A window will appear and mainly the values of the parameters that have been read form the input file are printed there. After the program has finished, which should take only a few seconds at most, two new files appear in the current folder. A file named devicefile.txt and a file named PHIinput_graph.gv . Both are text files again that can be opened in e.g. Notepad or Wordpad.
The file devicefile.txt is an input file for the actual simulator program PHIsim_v3.exe describing the device. The format however is, although sort of readable, not suitable to set-up yourself except for extremely simple devices. That is why the program PHIsim_input.exe exists.
The PHIinput_graph.gv is input file for a program that generates a graphic representation for the photonic circuit that is specified in the device_input_Fabry_Perot_laser.txt. This program is called GraphViz. It is a publicly available software from https://graphviz.org/.
The real simulator program is PHIsim_v3.exe. It requires three input files and an optional fourth. The first is the same parameter file as used with PHIsim_input.exe. The second file is the devicefile.txt generated by PHIsim_input.exe. The third file is a file with data on carrier densities in the simulations, these are starting values, in this case the file content indicates there are no starting values available. Further details on this file will be explained explained later. A fourth file is optional. It specifies optical input signals to the circuit as well as time dependent input values for current sources and phase modulators. For the simulation of a Fabry-Perot laser presented here it is not needed.
Now type at the command prompt: PHIsim_v3.exe PHIsim_input_pars.txt devicefile.txt carrierfile.txt photondfile.txt
The simulator now runs and some more output files are generated
- confirm_input.txt - contains the parameters that have been read from the input
- PHIsimout.txt - contains the simulation output data. These are time traces of two output points from the simulator.
- PHIsimout_car.txt - contains the carrier density values in the device at the end of the simulation
- PHIsimout_opt.txt - contains the photon density values in the device at the end of the simulation
If these files have appeared then the simulator is properly installed.