next up previous contents
Next: Modifying ``func_Schrodinger'' Up: Inward Schrödinger integrator Previous: Inward Schrödinger integrator

Modifying ``schint''

Generalize ``schint'' so that it tests whether k1<k2 (outward integration) or k1>k2 (inward integration) and then acts appropriately: changes the increment in the ``for'' loop and assigns positive values to h and dk. If you are clever, you can redesign the new code so that the same ``for'' loop handles both cases. Avoiding such replication of code (where you have nearly two identical ``for'' loops) also helps to reduce bugs. Often, when you make some change, you will forget to change the replicants.



Tomas Arias
Wed Feb 16 12:12:49 EST 2000