Add a call to osc_energy in the programs osc_FE.py and osc_EC.py and plot the sum of the kinetic and potential energy.
a) Make a function osc_energy(u, v, omega) for returning the potential and kinetic energy of an oscillating system described by (8.43)–(8.44). The potential energy…