//Example 8.1, page 287 clc u=0.927*10^-23//amp-m2 B=1//in J/amp-m2 E=2*u*B printf("\n Energy supplied to the dipole is %e J ",E)