Pythonic Virtual Machine
Installation

Documentation > Installation

Prerequisites

In order to use pyVAFM a working knowledge of how to use python is recommended although it is not mandatory since one can make input scripts by looking at the examples. Life will be a lot easier if you know at least some python as well as some knowledge object oriented programming. The following libraries and programs must be installed:

  • Python 2.7
  • gcc compiler (developed with v4.6.1)
  • scipy and numpy Python libraries

Installation

Navigate to the ./src/cCore directory and simply type "make all" into the console to compile the core library.

Running

In order to run the PyVAFM the user must first create a python input script. The exact nature of this script is described in section 3.1. The PyVAFM has two basic folders src and examples. The src folder contains all the source files and the examples folder contains an assortment of examples for each circuit (more on circuits later), hence the final step before you can run the PyVAFM scripts is to direct python the modules in the ./src folder. This can be done in two ways, you can either create a environmental variable that points towards the src folder or simply add this line to the top of all PyVAFM input files:

1 import sys
2 sys.path.append('/Users/johntracey/Desktop/pyvafm-master/src')

Except change /Users/johntracey/Desktop/pyvafm-master/src to whatever paths points to the ./src directory on your computer. It is worth noting that the above command must be entered before you import vafmcircuits. So now to run the PyVAFM you simply need to navigate to the folder with the input script and run that python script using whatever python interper you are using, most likely you will simply be able to type python followed by the input script into the terminal. In order to test if the PyVAFM is installed correctly I suggest you make the above modification to one of the example files, namely test_wavers.py. So run the python script using,

Python test_wavers.py

After this has run you should have a file outputted called "test_wavers.out". You can plot this using whatever plotting program you wish, but you should find that the output file contains 5 columns first, is time, 2nd is a sin wave, 3rd a cos wave, 4th a saw wave and 5th a square wave. If the above worked and the output file plots the correct wave then the PyVAFM has been installed correctly.


Documentation for pyVAFM
Generated on Wed Feb 8 2017 10:13:49 for pyVAFM by doxygen 1.8.9.1