- Python-Dymola model simulation
- Python-OpenModeling model simulation
- OpenIPSL element Dymola model verification:
- Simulate the Machine model examples and create .csv files with selected parameter for verification.
- Simulate the Exciter model examples and create .csv files with selected parameter for verification.
- All of the result files will be found in .../WorkingDir/ElementType/ElementName/Element.csv
Assuming an Ubuntu computer is being used and the PythonExcitersDymola.py script is being run:
- Change the dymola interface location: dymola = DymolaInterface("/YOUR_DYMOLA_LOCATION/dymola.sh")
- Open the OpenIPSL library. dymola.openModel("YOUR_OpenIPLS_LOCATION/OpenIPSL/package.mo")
- Make sure that the generator names are set correctly:
- Find the examples within OpenIPSL at: OpenIPSL.Examples.Controls.PSSE.ES...
- Go through each of the generators in each example and change the name.
- If the generator is 'GENROU' then change to 'gENROU'.
- If the generator is 'GENROE' then change to 'gENROE'.
- Change the dymola simulation location: dymola.cd("/YOUR_WORKINGDIR_LOCATION/Dymola/Exciters/" + exciterName)
- Change the result path location: resultPath = f"/YOUR_WORKIGNDIR_LOCATION/Dymola/Exciters/{exciterName}/" + exciterName
- Cahnge the simulation .mat result location: sim = SimRes(f"/YOUR_WORKINGDIR_LOCATION/Dymola/Exciters/{exciterName}/{exciterName}.mat"
- Change the current directory location: os.chdir(f"/YOUR_WOKRKIGDIR_LOCATION/Dymola/Exciters/{exciterName}/")
- Do this for the second section.
- Open terminal and enter cd /YOUR_REPOSITORY_LOCATION/Scripts/
- Type: python PythonExcitersDymola.py
- These scripts were done suing Dymola 2020 and OpenModelica 1.13.0.
- These scritpts are made for the latest release of the OpenIPSL library found at: https://github.com/OpenIPSL/OpenIPSL .
- Make sure that you change the file location to the ones of your computer.
- These scripts will only work using Ubuntu, if Windows is needed you need to change the structure of the files and the dymola installation location.
- It is easier to debug and change file directory using Jupyter Notebook and its files (.ipynb).
- To use the code just run the .py scripts.
- The results(for the ESAC1 exciter) (.csv files) will appear under: .../WorkingDir/Exciters/ESAC1/