Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93998080
dopri5-p.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, Dec 3, 03:22
Size
633 B
Mime Type
text/x-python
Expires
Thu, Dec 5, 03:22 (1 d, 4 h)
Engine
blob
Format
Raw Data
Handle
22697807
Attached To
rMARAFFO Master-cycle
dopri5-p.py
View Options
#!/usr/bin/python
import
matplotlib
import
numpy
as
np
import
matplotlib.pyplot
as
plt
p
=
[
80
,
70
,
60
,
50
,
40
,
30
,
20
]
eig
=
[
160
,
150
,
138
,
125
,
110
,
94
,
75
]
p
=
np
.
array
(
p
)
eig
=
np
.
array
(
eig
)
fit
=
np
.
polyfit
(
np
.
log
(
p
),
np
.
log
(
eig
),
1
)
fig
,
axis
=
plt
.
subplots
()
axis
.
set_title
(
"DOPRI5 estim"
)
axis
.
set_xlabel
(
"p"
)
axis
.
set_ylabel
(
"lambda"
)
axis
.
loglog
(
p
,
eig
,
'r*'
,
label
=
'data'
)
axis
.
loglog
(
p
,
np
.
exp
(
fit
[
0
]
*
np
.
log
(
p
)
+
fit
[
1
]),
'k-'
,
label
=
'fit'
)
axis
.
legend
()
plt
.
show
()
print
(
"Fit:
%g
* p^
%g
"
%
(
np
.
exp
(
fit
[
1
]),
fit
[
0
]))
Event Timeline
Log In to Comment