Help us understand the problem. What is going on with this article?

# matplotlibメモ書き

More than 1 year has passed since last update.

## コンデンサ間の等電位線と電気力線の解析解をグラフ化する必要があったのでメモ

コンデンサ間の等電位線と電気力線の解析解は、

\left\{
\begin{array}{ll}
x = L\,(\,t+\frac{1}{\pi}e^{\pi t}\,cos\,(\frac{\pi V}{V_0}))\\
y = L\,(\,\frac{V}{V_0}+\frac{1}{\pi}e^{\pi t}\,sin\,(\frac{\pi V}{V_0}))\\
\end{array}
\right.



で与えられる。

E_field.py
import numpy as np
import matplotlib.pyplot as plt

L=12

t_vect = np.linspace(-2, 0.4, 201)
v_vect = np.linspace(-4, 4, 201)

V=[1,2,3,4,5,6,7,8,9]
potential = {}
for v in V:
potential[v]=[]
potential[v].append(L *(t_vect + 1/np.pi * np.exp(np.pi * t_vect) * np.cos((v-5)/(5)*np.pi)))
potential[v].append(L *((v-5)/5 + 1/np.pi * np.exp(np.pi * t_vect) * np.sin((v-5) / 5 *np.pi)))

T=[-1.8,-1.5,-1.2,-0.9,-0.6,-0.3,0,0.3]
force_line ={}
for t in T:
force_line[t]=[]
force_line[t].append(L *(t + 1/np.pi * np.exp(np.pi * t) * np.cos((v_vect)/(5)*np.pi)))
force_line[t].append(L *((v_vect)/5 + 1/np.pi * np.exp(np.pi * t) * np.sin((v_vect) / 5 *np.pi)))

plt.hold(True);
for f in potential.values():
plt.plot(f[0], f[1], color='black',  linestyle='solid')
for f in force_line.values():
plt.plot(f[0], f[1], color='black',  linestyle='dashed')

plt.xlabel('x[cm]')
plt.ylabel('y[cm]')

plt.savefig("fig.png")


plt.hold(True)で複数の線を一個のグラフに描画
plt.plot(f[0], f[1], color='black', linestyle='solid')で線の色と種類を指定

P.S.

Why do not you register as a user and use Qiita more conveniently?
1. We will deliver articles that match you
By following users and tags, you can catch up information on technical fields that you are interested in as a whole
2. you can read useful information later efficiently
By "stocking" the articles you like, you can search right away