Skip to main content
\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)
Mathematics LibreTexts

10.4 Simulation without PyCX

Finally, I would like to emphasize an important fact: The PyCX simulator file used in this chapter was used only for creating a GUI, while the core simulation model was still fully implemented in your own code. This means that your simulation model is completely independent of PyCX, and once the interactive exploration and model verification is over, your simulator can “graduate” from PyCX and run on its own. 

For example, here is a revised version of Code 10.6, which automatically generates a series of image files without using PyCX at all. You can generate an animated movie from the saved image files using, e.g., Windows Movie Maker. This is a nice example that illustrates the main purpose of PyCX—to serve as a stepping stone for students and

fig 10.3.png

researchers in learning complex systems modeling and simulation, so that it eventually becomes unnecessary once they have acquired sufficient programming skills.


code 10.11.png

code 10.11 pt2.png

code 10.11 pt3.png

Exercise 10.3

Develop your own interactive simulation code. Explore various features of the plotting functions and the PyCX simulator’s GUI. Then revise your code so that it automatically generates a series of image files without using PyCX. Finally, create an animated movie file using the image files generated by your own code. Enjoy!