-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathplotym.py
More file actions
34 lines (30 loc) · 749 Bytes
/
plotym.py
File metadata and controls
34 lines (30 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import concore
import numpy as np
import matplotlib.pyplot as plt
import time
print("plotym")
concore.delay = 0.02
concore.default_maxtime(150)
init_simtime_u = "[0.0, 0.0]"
init_simtime_ym = "[0.0, 0.0]"
ymt = []
ym = concore.initval(init_simtime_ym)
while(concore.simtime<concore.maxtime):
while concore.unchanged():
ym = concore.read(1,"ym",init_simtime_ym)
concore.write(1,"ym",ym)
print("ym="+str(ym))
ymt.append(np.array(ym).T)
print("retry="+str(concore.retrycount))
#################
# plot inputs and outputs
ym1 = [x[0].item() for x in ymt]
Nsim = len(ym1)
plt.figure()
plt.subplot(111)
plt.plot(range(Nsim), ym1)
plt.ylabel('ym')
plt.legend(['ym'], loc=0)
plt.xlabel('Cycles')
plt.savefig("ym.pdf")
plt.show()