<jupyter_start><jupyter_text>Elipsoide Problema Direto Emerson Teste 1 - <NAME>  Coisas para importar<jupyter_code>import numpy as np
from scipy import linalg
from matplotlib import pyplot as plt

%matplotlib inline<jupyter_output><empty_output><jupyter_text>Importar minhas funções de um arquivo externo<jupyter_code>import Elipsoide_Clark_FAT_Unificado as me<jupyter_output><empty_output><jupyter_text>Input<jupyter_code>Xp = np.array([-100., -50., 0., 50., 100., 150., 200.])
Yp = np.zeros_like(Xp)
Zp = np.zeros_like(Xp)

#xc posicao x , yc posição y e h profundidade reais
xc = 0.
yc = 0.
zc = 250.

# Orientacoes do elipsoide
azimuth = 90.
azimuth_O = 20.
delta = 45.
gamma = 0.

# Eixos do elipsoide
a = 175.
b = 75.
a_O = 75.
b_O = 150.

# Set the inclination and declination of the regional field
inten, inc, dec  = 60000., -65., -35.0    #nT, graus, graus

################################################################################################################################
################################################################################################################################

model_P = []
# Create a ellipsoid model (Prolate)
model_P.append(me.Ellipsoid(Xp, Yp, Zp, xc, yc, zc, a, b, b, azimuth, delta, gamma, 
                          {'remanence': np.array([12000, 90., 0.]),
                           'k1': np.array([0.12, 0., 90.]),
                           'k2': np.array([0.10, 0., 180.]),
                           'k3': np.array([0.08, 90., 0.])}
                          ))

################################################################################################################################
################################################################################################################################

model_O = []
# Create a ellipsoid model (Prolate)
model_O.append(me.Ellipsoid(Xp, Yp, Zp, xc, yc, zc, a_O, b_O, b_O, azimuth_O, delta, gamma, 
                          {'remanence': np.array([12000, 90., 0.]),
                           'k1': np.array([0.12, 0., 90.]),
                           'k2': np.array([0.10, 0., 180.]),
                           'k3': np.array([0.08, 90., 0.])}
                          ))<jupyter_output><empty_output><jupyter_text>Cálculos<jupyter_code># Calculate the anomaly for a given regional field (Prolate)
JRD_cart_P = me.jrd_cartesiano (inten,inc,dec,model_P)
Bx_P = me.bx_c (Xp,Yp,Zp,inten,inc,dec,model_P)
By_P = me.by_c (Xp,Yp,Zp,inten,inc,dec,model_P)
Bz_P = me.bz_c (Xp,Yp,Zp,inten,inc,dec,model_P)
Tf_P = me.tf_c (Xp,Yp,Zp,inten,inc,dec,model_P)
JRD_cart_P
# Calculate the anomaly for a given regional field (Oblate)
JRD_cart_O = me.jrd_cartesiano (inten,inc,dec,model_O)
Bx_O = me.bx_c (Xp,Yp,Zp,inten,inc,dec,model_O)
By_O = me.by_c (Xp,Yp,Zp,inten,inc,dec,model_O)
Bz_O = me.bz_c (Xp,Yp,Zp,inten,inc,dec,model_O)
Tf_O = me.tf_c (Xp,Yp,Zp,inten,inc,dec,model_O)<jupyter_output><empty_output><jupyter_text>Resultado da minha função<jupyter_code>print Bz_P
print Bz_O
print Tf_P
print Tf_O<jupyter_output>[  4.75989665e+08   4.35083162e+08   4.41103502e+08   4.87895070e+08
   5.72166401e+08   6.93698617e+08   8.53921965e+08]<jupyter_text>Resultado proveniente de outra implementação<jupyter_code>Bz_Emerson = np.array([2128.8, 2921.4, 3117.2, 2468.1, 1484.0, 704.3, 246.7])
Bz_Emerson
Bz_Emerson_O = np.array([4642.5, 5077.4, 4337.6, 2994.0, 1705.4, 769.6, 202.3])
Bz_Emerson_O
Bt_Emerson = np.array([-1690.1, -2686.1, -3262.6, -2943.8, -2066.5, -1225.5, -652.9])
Bt_Emerson
Bt_Emerson_O = np.array([-3075.8, -4708.3, -4596.4, -3646.8, -2475.3, -1477.9, -776.2])
Bt_Emerson_O<jupyter_output><empty_output><jupyter_text>Resultados<jupyter_code>plt.figure(figsize=(8,8))

plt.plot()
plt.plot(Xp, Bz_P, '-ko', label="Implementacao propria")
plt.plot(Xp, Bz_Emerson, '--ks', label="Implementacao Emerson")
plt.xlabel('Distancia (m)')
plt.ylabel('Bz (nT)')
plt.title('Campo magnetico Prolato')
plt.grid(True)
plt.legend()
#plt.savefig('Bz_Emerson.jpg', dpi=200)
plt.show()
plt.figure(figsize=(8,8))

plt.plot()
plt.plot(Xp, Tf_P, '-ko', label='Implementacao propria')
plt.plot(Xp, Bt_Emerson, '--ks', label="Implementacao Emerson")
plt.xlabel('Distancia (m)')
plt.ylabel('Anomalia (nT)')
plt.title('Campo magnetico  Prolato')
plt.grid(True)
plt.legend()
#plt.savefig('Anomalia_Emerson.jpg', dpi=200)
plt.show()
plt.figure(figsize=(8,8))

plt.plot()
plt.plot(Xp, Bz_O, '-ko', label="Implementacao propria")
plt.plot(Xp, Bz_Emerson_O, '--ks', label="Implementacao Emerson")
plt.xlabel('Distancia (m)')
plt.ylabel('Bz (nT)')
plt.title('Campo magnetico Oblato')
plt.grid(True)
plt.legend()
#plt.savefig('Bz_Emerson.jpg', dpi=200)
plt.show()
plt.figure(figsize=(8,8))

plt.plot()
plt.plot(Xp, Tf_O, '-ko', label='Implementacao propria')
plt.plot(Xp, Bt_Emerson_O, '--ks', label="Implementacao Emerson")
plt.xlabel('Distancia (m)')
plt.ylabel('Anomalia (nT)')
plt.title('Campo magnetico  Oblato')
plt.grid(True)
plt.legend()
#plt.savefig('Anomalia_Emerson.jpg', dpi=200)
plt.show()<jupyter_output><empty_output><jupyter_text>Teste de validação<jupyter_code>Bz_Emerson/Bz_P
Bz_Emerson_O/Bz_O
Bt_Emerson/Tf_P
Bt_Emerson_O/Tf_O<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.25173343605546994, 'fraction_numerical': 0.06567796610169492, 'mean_word_length': 4.687842278203724, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '657132', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 2434, 'n_tokens_neox': 2150, 'n_words': 375, 'path': 'code/Elipsoide_Problema_Direto_Emerson_Comparacao.ipynb', 'repo_name': 'birocoles/paper-magnetic-elipsoid', 'size': '5211'}