Gradient of a bent loop
| bent loop gradient.biot |
To test the gradient calculation for a wire, we use the same square loop used used in the bent loop magnetic field lines calculation. We add a linear probe starting at the origin of the magnetic field line and extending to the center of the loop. This probe displays the gradient of the magnetic induction.
Results
Here is a graph of the field gradient matrix elements along the line probe:
The gradient export gives export-gradient.txt. For immediate verification of program functionality we give the gradient at (0.2,0,0.2) in the following table:
| Quantity | Analytic | Numeric |
|---|---|---|
| dBxdx | +1.451443e+01 | +1.4514e+01 |
| dBxdy | +2.080802e-01 | +2.0850e-01 |
| dBxdz | +2.158894e+01 | +2.1589e+01 |
| dBydx | +2.080802e-01 | +2.0800e-01 |
| dBydy | -1.238999e+01 | -1.2390e+01 |
| dBydz | +3.223786e+00 | +3.2239e+00 |
| dBzdx | +2.158894e+01 | +2.1589e+01 |
| dBzdy | +3.223786e+00 | +3.2235e+00 |
| dBzdz | -2.124436e+00 | -2.1255e+00 |
The "analytic" quantity is the gradient calculated by BiotSavart using closed-form expressions. The "numeric" quantity is the calculated derivative found "by hand" using central differences using data calculated using the dx, dy, and dz probes.