def show(self):
self.animation = animation.FuncAnimation(
self.fig, self.update, len(self.data["time"]),
- interval = 100,
+ interval = 10,
blit=False);
plt.show();
def update(self, frame):
for line in self.lines:
- from_frame = 0;
+ from_frame = frame - 100;
to_frame = frame;
line.line.set_data([
self.data[line.name_x][from_frame:to_frame],
ani = matAniFromFile(sys.argv[1]);
-for i in range(1,11):
+for i in range(1, 11):
ani.plot(
"p[" + str(i) + "].pos[1]",
"p[" + str(i) + "].pos[2]",
end unitvec;
model System
- parameter Integer N = 4;
+ parameter Integer N = 10;
Planet p[N];
RelPosition pos[N, N];
p[i].pos[1] = sin(i);
p[i].pos[2] = cos(i);
p[i].pos[3] = sin(3 * i);
- p[i].speed[1] = cos(2 * i);
- p[i].speed[2] = sin(3 * i);
- p[i].speed[3] = cos(i);
+ p[i].speed[1] = cos(2 * i) / 10;
+ p[i].speed[2] = sin(3 * i) / 10;
+ p[i].speed[3] = cos(i) / 10;
end for;
equation