Page 4 - Physlets and Open Source Physics for Quantum Mechanics:
P. 4

modification and redistribution of compiled Java programs is not an easy task for many
                 teachers and students.  It is not, however, necessary to become expert in programming
                 to use our materials.  Although the source code will be available for Java experts, our
                 programs store their internal parameters using Extensible Markup Language (XML).  A
                 teacher can, for example, load a pre-defined multi-state quantum superposition
                 demonstration using the data saved as an XML file shown in Figure 3.  Because XML
                 data files are character-based, it is straightforward to edit properties such as the
                 expansion coefficients to create custom simulations.

                        <?xml version="1.0" encoding="UTF-8" ?>
                        <object class="org.opensourcephysics.controls.OSPApplication">
                        <property name="control" type="object">
                        <object class="org.opensourcephysics.controls.AnimationControl">
                             <property name="initialize_mode" type="boolean">false</property>
                             <property name="dt" type="string">0.01</property>
                             <property name="x min" type="string">-5</property>
                             <property name="x max" type="string">5</property>
                             <property name="psi range" type="string">1</property>
                            <property name="re coef" type="string">{0.7,0.7}</property>
                             <property name="im coef" type="string">{0,0}</property>
                             <property name="V(x)" type="string">sho</property>
                            </object>
                            </property>
                        <property name="model" type="object">
                        <object
                        class="org.opensourcephysics.davidson.qm.QMSuperpositionApp" />
                        </property>
                        </object>

                        Figure 3: XML code for the QMSuperpositionApp from Figure 2.



                 Launcher






















                          Figure 4: A Launcher window for the suite of quantum-mechanical
                          revival simulations based on the program QMSuperpositionApp.
                          Double clicking on SuperpositionApp opens the node showing a set of
                          programs based on the SuperpostionApp program.  Double clicking on
                          an end-node executes the program.


                 Like Physlets, OSP provides a framework for embedding programs into HTML pages
                 and for controlling these programs using JavaScript.  Unlike Physlets, programs can
   1   2   3   4   5   6   7   8   9