Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90321002
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
Thu, Oct 31, 11:58
Size
1 KB
Mime Type
text/x-python
Expires
Sat, Nov 2, 11:58 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22022606
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