Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78362658
plot_series.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Aug 20, 04:33
Size
1 KB
Mime Type
text/x-python
Expires
Thu, Aug 22, 04:33 (2 d)
Engine
blob
Format
Raw Data
Handle
20024753
Attached To
R7571 SP4E-TB-TL-FR
plot_series.py
View Options
from
__future__
import
print_function
from
dumper_series
import
DumperSeries
import
matplotlib.pyplot
as
plt
################################################################
class
PlotSeries
(
DumperSeries
):
def
__init__
(
self
,
series
,
maxiter
,
freq
):
DumperSeries
.
__init__
(
self
,
series
)
self
.
maxiter
=
maxiter
self
.
freq
=
freq
def
__del__
(
self
):
pass
def
dump
(
self
):
fig
=
plt
.
figure
()
axe
=
fig
.
add_subplot
(
1
,
1
,
1
)
x
=
[]
numerical
=
[]
analytic
=
[]
for
i
in
range
(
1
,
int
(
self
.
maxiter
/
self
.
freq
)):
res
=
self
.
series
.
compute
(
i
*
self
.
freq
-
1
)
x
.
append
(
i
*
self
.
freq
)
numerical
.
append
(
res
)
analytic
.
append
(
self
.
series
.
getAnalyticPrediction
())
axe
.
plot
(
x
,
numerical
,
marker
=
'o'
,
label
=
'Numerical'
)
axe
.
plot
(
x
,
analytic
,
label
=
'Analytical'
)
axe
.
set_xlabel
(
r'$k$'
)
axe
.
set_ylabel
(
r'Series'
)
axe
.
legend
()
plt
.
show
()
return
"Plotted"
Event Timeline
Log In to Comment