|
96 | 96 | "metadata": {}, |
97 | 97 | "outputs": [], |
98 | 98 | "source": [ |
99 | | - "system = mm.System(name='stdprob4')" |
| 99 | + "system = mm.System(name=\"stdprob4\")" |
100 | 100 | ] |
101 | 101 | }, |
102 | 102 | { |
|
299 | 299 | ], |
300 | 300 | "source": [ |
301 | 301 | "# x-component\n", |
302 | | - "system.m.x.sel('z').mpl()" |
| 302 | + "system.m.x.sel(\"z\").mpl()" |
303 | 303 | ] |
304 | 304 | }, |
305 | 305 | { |
|
320 | 320 | ], |
321 | 321 | "source": [ |
322 | 322 | "# y-component\n", |
323 | | - "system.m.y.sel('z').mpl()" |
| 323 | + "system.m.y.sel(\"z\").mpl()" |
324 | 324 | ] |
325 | 325 | }, |
326 | 326 | { |
|
341 | 341 | ], |
342 | 342 | "source": [ |
343 | 343 | "# vectors\n", |
344 | | - "system.m.sel('z').mpl()" |
| 344 | + "system.m.sel(\"z\").mpl()" |
345 | 345 | ] |
346 | 346 | }, |
347 | 347 | { |
|
375 | 375 | "fig, ax = plt.subplots(figsize=(20, 5))\n", |
376 | 376 | "\n", |
377 | 377 | "# plot vectors on grid of 20 x 5 over the numerical resulotion\n", |
378 | | - "system.m.sel('z').resample((20, 5)).mpl.vector(ax=ax)\n", |
| 378 | + "system.m.sel(\"z\").resample((20, 5)).mpl.vector(ax=ax)\n", |
379 | 379 | "\n", |
380 | 380 | "# add colouring for mx-component to this plot\n", |
381 | | - "system.m.x.sel('z').mpl.scalar(ax=ax, cmap='magma')" |
| 381 | + "system.m.x.sel(\"z\").mpl.scalar(ax=ax, cmap=\"magma\")" |
382 | 382 | ] |
383 | 383 | }, |
384 | 384 | { |
|
408 | 408 | } |
409 | 409 | ], |
410 | 410 | "source": [ |
411 | | - "print('The average magnetisation is {}.'.format(system.m.mean()))\n", |
| 411 | + "print(\"The average magnetisation is {}.\".format(system.m.mean()))\n", |
412 | 412 | "\n", |
413 | | - "print('The magnetisation at the mesh centre {}\\nis {}.'.format(\n", |
414 | | - " system.m.mesh.region.centre, system.m(system.m.mesh.region.centre)))" |
| 413 | + "print(\n", |
| 414 | + " \"The magnetisation at the mesh centre {}\\nis {}.\".format(\n", |
| 415 | + " system.m.mesh.region.centre, system.m(system.m.mesh.region.centre)\n", |
| 416 | + " )\n", |
| 417 | + ")" |
415 | 418 | ] |
416 | 419 | }, |
417 | 420 | { |
|
435 | 438 | "outputs": [], |
436 | 439 | "source": [ |
437 | 440 | "# Add Zeeman energy term to the Hamiltonian\n", |
438 | | - "H1 = (-24.6e-3/mm.consts.mu0, 4.3e-3/mm.consts.mu0, 0.0)\n", |
| 441 | + "H1 = (-24.6e-3 / mm.consts.mu0, 4.3e-3 / mm.consts.mu0, 0.0)\n", |
439 | 442 | "system.energy += mm.Zeeman(H=H1)" |
440 | 443 | ] |
441 | 444 | }, |
|
749 | 752 | } |
750 | 753 | ], |
751 | 754 | "source": [ |
752 | | - "myplot = system.table.data.plot('t', 'my')" |
| 755 | + "myplot = system.table.data.plot(\"t\", \"my\")" |
753 | 756 | ] |
754 | 757 | }, |
755 | 758 | { |
|
783 | 786 | "fig, ax = plt.subplots(figsize=(20, 5))\n", |
784 | 787 | "\n", |
785 | 788 | "# plot vectors on grid of 20 x 5 over the numerical resulotion\n", |
786 | | - "system.m.sel('z').resample((20, 5)).mpl.vector(ax=ax)\n", |
| 789 | + "system.m.sel(\"z\").resample((20, 5)).mpl.vector(ax=ax)\n", |
787 | 790 | "\n", |
788 | 791 | "# add colouring for mx-component to this plot\n", |
789 | | - "system.m.x.sel('z').mpl.scalar(ax=ax, cmap='magma')" |
| 792 | + "system.m.x.sel(\"z\").mpl.scalar(ax=ax, cmap=\"magma\")" |
790 | 793 | ] |
791 | 794 | }, |
792 | 795 | { |
|
0 commit comments