add
This commit is contained in:
1 parent
bd49911eca
commit
e3de01bde8
3742 files changed
+64316
No files matched your search
@@ -0,0 +1,23 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
K = int(input("K = \n"))
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(0,K):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
def s1(x):
|
||||
res = 0
|
||||
for i in range(0,K):
|
||||
res += - T/(2*pi*(2*i+1)**2) * cos(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e2(t), "r", t, s1(t), "b")
|
||||
show()
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 1000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(1,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*pi+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,15 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
#t = [i/N for i in range(floor(2*T))]
|
||||
|
||||
#def e1(t):
|
||||
#return sin(2*pi*t/(2*T))
|
||||
|
||||
#plot(t,e1(t))
|
||||
#show()
|
||||
|
||||
print(floor(2*pi))
|
||||
@@ -0,0 +1,14 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = [i/N for i in range(int(floor(2*T)))]
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
|
||||
plot(t,e1(t))
|
||||
show()
|
||||
@@ -0,0 +1,8 @@
|
||||
from math import *
|
||||
from matplotlib import *
|
||||
|
||||
T = 2*pi
|
||||
|
||||
def e1(t):
|
||||
return sin()
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
from math import *
|
||||
from matplotlib import *
|
||||
|
||||
T = 2*pi
|
||||
|
||||
def e1(t):
|
||||
return sin()
|
||||
|
||||
plot(e1,)
|
||||
@@ -0,0 +1,16 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
for i in range(1,5)
|
||||
|
||||
plot(t, e1(t))
|
||||
show()
|
||||
@@ -0,0 +1,9 @@
|
||||
from math import *
|
||||
from matplotlib import *
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
|
||||
def e1(t):
|
||||
return sin()
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(0,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
def s1
|
||||
|
||||
plot(t, e2(t), "r", t, s1(t), "b")
|
||||
show()
|
||||
@@ -0,0 +1,11 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 5., 0.2)
|
||||
|
||||
# red dashes, blue squares and green triangles
|
||||
plot(t, t)
|
||||
show()
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(1,200):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(1,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*pi+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), "b", t, t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,12 @@
|
||||
from math import *
|
||||
from matplotlib import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
x = arange()
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
plot()
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(0,200):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,23 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
K = int(input("K = \n"))
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(0,K):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
def s1(x):
|
||||
res = 0
|
||||
for i in range(0,K):
|
||||
res += 0
|
||||
return res
|
||||
|
||||
plot(t, e2(t), "r", t, s1(t), "b")
|
||||
show()
|
||||
@@ -0,0 +1,13 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = [i/N for i in range(int(floor(2*T)))]
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
plot(t,e1(t))
|
||||
show()
|
||||
@@ -0,0 +1,17 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
for i in range(1,5):
|
||||
(1/(2*i+1)) * sin(2*pi*(2*pi+1)*x/T)
|
||||
|
||||
plot(t, e1(t), t, "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,6 @@
|
||||
from math import *
|
||||
from matplotlib import plot
|
||||
|
||||
def e1(t):
|
||||
return sin()
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(0,K):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
def s1(x):
|
||||
res = 0
|
||||
for i in range(0,K):
|
||||
|
||||
plot(t, e2(t), "r", t, s1(t), "b")
|
||||
show()
|
||||
@@ -0,0 +1,12 @@
|
||||
from math import *
|
||||
from matplotlib import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = [i/N from i in range(floor(2*T))]
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
plot(t,e1(t))
|
||||
@@ -0,0 +1,17 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
for i in range(1,5):
|
||||
(1/(2*i+1)) * sin(2*pi*(2*pi+1)*x/T)
|
||||
|
||||
plot(t, e1(t), t, t, e2(t))
|
||||
show()
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(1,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*pi+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), t, t, e2(t))
|
||||
show()
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 1000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(1,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,11 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
# red dashes, blue squares and green triangles
|
||||
plot(t, t)
|
||||
show()
|
||||
@@ -0,0 +1,14 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
t = [i/N for i in range(int(floor(2*T)))]
|
||||
|
||||
plot(t,e1(t))
|
||||
show()
|
||||
@@ -0,0 +1,15 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = [i/N for i in range(floor(2*T))]
|
||||
|
||||
#def e1(t):
|
||||
#return sin(2*pi*t/(2*T))
|
||||
|
||||
#plot(t,e1(t))
|
||||
#show()
|
||||
|
||||
print(floor(2*pi))
|
||||
@@ -0,0 +1 @@
|
||||
{"version":1,"resource":"file:///home/jvj/%CF%86Tp/TP1.py","entries":[{"id":"MOlO.py","timestamp":1725806443853},{"id":"51ct.py","timestamp":1725806518279},{"id":"3uDu.py","timestamp":1725806566917},{"id":"7zch.py","timestamp":1725806675180},{"id":"vjuE.py","timestamp":1725806704475},{"id":"pQc7.py","timestamp":1725806794114},{"id":"GipB.py","timestamp":1725806846797},{"id":"xkXx.py","timestamp":1725806941881},{"id":"pDYH.py","timestamp":1725806953197},{"id":"SQpX.py","timestamp":1725806986000},{"id":"nSRn.py","timestamp":1725807001243},{"id":"rc44.py","timestamp":1725807032327},{"id":"awzu.py","timestamp":1725807253600},{"id":"0R2H.py","timestamp":1725807287317},{"id":"Kapt.py","timestamp":1725807313656},{"id":"YTEG.py","timestamp":1725807340650},{"id":"2exs.py","timestamp":1725807355726},{"id":"sv0Q.py","timestamp":1725807370541},{"id":"vdLz.py","timestamp":1725807420991},{"id":"xaQC.py","timestamp":1725807684902},{"id":"9nc5.py","timestamp":1725807705510},{"id":"Xuao.py","timestamp":1725807726641},{"id":"x6c2.py","timestamp":1725807848177},{"id":"5kt5.py","timestamp":1725807908854},{"id":"ipS3.py","timestamp":1725807998350},{"id":"fS9g.py","timestamp":1725808032693},{"id":"tYlZ.py","timestamp":1725808061526},{"id":"LOme.py","timestamp":1725808074757},{"id":"SilE.py","timestamp":1725808131927},{"id":"Sz9U.py","timestamp":1725808157426},{"id":"GNwh.py","timestamp":1725808168143},{"id":"lxXi.py","timestamp":1725808197138},{"id":"0LLW.py","timestamp":1725808219467},{"id":"U8uU.py","timestamp":1725808283091},{"id":"u4E3.py","timestamp":1725808360322},{"id":"p0Zz.py","timestamp":1725808456918},{"id":"EAzD.py","timestamp":1725808470532},{"id":"HP2T.py","timestamp":1725808567298},{"id":"shEQ.py","timestamp":1725808623916},{"id":"nKXi.py","timestamp":1725808975091},{"id":"sdqP.py","timestamp":1725808985454},{"id":"8zga.py","timestamp":1725809006390},{"id":"RGUi.py","timestamp":1725809054801},{"id":"ugHI.py","timestamp":1725809078529},{"id":"KLUp.py","timestamp":1725809097968},{"id":"0Ee4.py","timestamp":1725809304546}]}
|
||||
@@ -0,0 +1,17 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
for i in range(1,5):
|
||||
(1/(2*i+1)) * sin(2*pi*(2*pi+1)*x/T)
|
||||
|
||||
plot(t, e1(t), t, "--b", e2(t), "--r")
|
||||
show()
|
||||
@@ -0,0 +1,17 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
for i in range(1,5):
|
||||
(1/(2*i+1)) * sin(2*pi*(2*pi+1)*x/T)
|
||||
|
||||
plot(t, e1(t), t, e2(t), "--r")
|
||||
show()
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(1,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*pi+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,18 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(0,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
def
|
||||
|
||||
plot(t, e1(t), "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,12 @@
|
||||
from math import *
|
||||
from matplotlib import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = [i/N for i in range(floor(2*T))]
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
plot(t,e1(t))
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(1,20):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,12 @@
|
||||
from math import *
|
||||
from matplotlib import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
x = [i/N from i in range(floor(2*T))]
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
plot(X,e1(t))
|
||||
@@ -0,0 +1,11 @@
|
||||
from math import *
|
||||
from matplotlib import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
plot()
|
||||
@@ -0,0 +1,13 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = [i/N for i in range(floor(2*T))]
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
plot(t,e1(t))
|
||||
show()
|
||||
@@ -0,0 +1,18 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(0,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
def s1
|
||||
|
||||
plot(t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(0,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,14 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = [i/N for i in range(int(floor(2*T)))]
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/(2*T))
|
||||
|
||||
|
||||
plot(t,e1(t))
|
||||
show()
|
||||
@@ -0,0 +1,17 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
for i in range(1,5):
|
||||
(1/(2*i+1)) * sin(2*pi*(2*pi+1)*x/T)
|
||||
|
||||
plot(t, e1(t), t, "b", e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,19 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(1,5):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
plot(t, e1(t), "b", t, e2(t), "r")
|
||||
show()
|
||||
@@ -0,0 +1,21 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 10000
|
||||
t = arange(0., 2*T, T/N)
|
||||
K = int(input("K = \n"))
|
||||
|
||||
def e2(x):
|
||||
res = 0
|
||||
for i in range(0,K):
|
||||
res += (1/(2*i+1)) * sin(2*pi*(2*i+1)*x/T)
|
||||
return res
|
||||
|
||||
def s1(x):
|
||||
res = 0
|
||||
for i in range(0,K):
|
||||
|
||||
plot(t, e2(t), "r", t, s1(t), "b")
|
||||
show()
|
||||
@@ -0,0 +1,10 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
# evenly sampled time at 200ms intervals
|
||||
t = arange(0., 5., 0.2)
|
||||
|
||||
# red dashes, blue squares and green triangles
|
||||
plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^')
|
||||
show()
|
||||
@@ -0,0 +1,10 @@
|
||||
from math import *
|
||||
from matplotlib import *
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
t = arange(0., 2*T, T/N)
|
||||
|
||||
def e1(x):
|
||||
return sin(2*pi*x/T)
|
||||
|
||||
plot(t, e1(t))
|
||||
show()
|
||||
@@ -0,0 +1,10 @@
|
||||
from math import *
|
||||
from matplotlib.pyplot import plot,show
|
||||
from numpy import *
|
||||
|
||||
N = 100
|
||||
t = arange(0., 5., 0.2)
|
||||
|
||||
# red dashes, blue squares and green triangles
|
||||
plot(t, t)
|
||||
show()
|
||||
@@ -0,0 +1,12 @@
|
||||
from math import *
|
||||
from matplotlib import plot,show
|
||||
from numpy import *
|
||||
|
||||
T = 2*pi
|
||||
N = 100
|
||||
x = [i/N from i in range(2*T)]
|
||||
|
||||
def e1(t):
|
||||
return sin(2*pi*t/(2*T))
|
||||
|
||||
plot(X,e1(t))
|
||||
Reference in new issue
Block a user