-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSingularity_Effect.py
62 lines (56 loc) · 2.35 KB
/
Singularity_Effect.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 11 13:48:27 2021
@author: simon
"""
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from SECpy import Vdf, theta
import pickle
lon, lat =np.meshgrid(np.linspace(-20, 20), np.linspace(-20, 20))
fig= plt.figure()
ax= fig.add_subplot(111, projection='3d')
z= Vdf(theta(0, 0, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(10, 0, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(-10, 0, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(0, -10, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(0, 10, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(10, 0, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(-10, 10, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(10, -10, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(10, 10, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(10, -10, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(-10, -10, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(-10, -10, lon, lat), 110e3, theta0=np.deg2rad(5))
z+= Vdf(theta(-10, 10, lon, lat), 110e3, theta0=np.deg2rad(5))
ax.plot_surface(lon, lat, z, rstride=1, cstride=1,
cmap='winter', edgecolor='none')
ax.set_ylabel('latitude')
ax.set_xlabel('longitude')
ax.set_zlabel('Current')
fig.suptitle('Singularity Adjusted')
pickle.dump(fig, open('singularity.pickle', 'wb'))
fig= plt.figure()
ax= fig.add_subplot(111, projection='3d')
z= Vdf(theta(0, 0, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(10, 0, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(-10, 0, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(0, -10, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(0, 10, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(10, 0, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(-10, 10, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(10, -10, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(10, 10, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(10, -10, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(-10, -10, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(-10, -10, lon, lat), 110e3, theta0=0)
z+= Vdf(theta(-10, 10, lon, lat), 110e3, theta0=0)
ax.plot_surface(lon, lat, z, rstride=1, cstride=1,
cmap='winter', edgecolor='none')
ax.set_ylabel('latitude')
ax.set_xlabel('longitude')
ax.set_zlabel('Current')
fig.suptitle('Normal')
pickle.dump(fig, open('normal.pickle', 'wb'))