Ejemplo n.º 1
0
frames = 1000

if anim:
    Ns = (300, 300)
    side_length = (1 / 3.)
    square_coaxial_cable = Shape(Ns,
                                 1.5, (0.5, 0.5),
                                 3e-1,
                                 side_length,
                                 shape='square',
                                 filled=True)
    cable = System(Ns)
    cable.add(square_coaxial_cable)

    all_potentials = cable.SOR_anim(w=1.9999999999999999999999999995,
                                    tol=0,
                                    max_iter=frames)
    plt.ioff()
    fig, ax = plt.subplots(figsize=(15, 15))
    image = plt.imshow(all_potentials[0].T,
                       vmin=np.min(all_potentials),
                       vmax=np.max(all_potentials),
                       interpolation='none',
                       aspect='equal',
                       extent=None,
                       origin='lower')
    iter_text = ax.text(0.05,
                        0.95,
                        '',
                        transform=ax.transAxes,
                        size=20,