What is this?
Hello, I have animation trajectory of motion. I have displayed as line it. But I need displayed as point, which will move.
Sorry, once more:
restart;
with(DEtools):with(plots):
vx := diff(x(t), t) = -(x(t)-y(t))/sqrt(x(t)^2+y(t)^2);
vy := diff(y(t), t) = -(x(t)+y(t))/sqrt(x(t)^2+y(t)^2);
sys := {vx, vy}:
init := [[x(0) = 1, y(0) = 1], [x(0) = 1, y(0) = -1], [x(0) = -1, y(0) = -1], [x(0) = -1, y(0) = 1]]:
animate(DEplot, [sys, [x(t), y(t)], t = 0 .. T, x = -1 .. 1, y = -1 .. 1, init, stepsize = 0.1e-1, thickness = 1, arrows = none, title = "Animace", linecolor = [red, blue, gold, black]], T = 0.1e-2 .. sqrt(2));
S:= [seq(subs(dsolve(sys union {op(v)}, numeric, output=listprocedure),[x(t),y(t)]),v=init)];
display([seq](pointplot(S(sqrt(2)*j/50),colour=[red,blue,gold,black]),j=1..50),insequence=true);
OK, thank you.
And when I want display trajectory as line and as point in one graph?
display([seq]( display([pointplot(S(j*sqrt(2)/50),colour=[red,blue,gold,black]), DEplot(sys, [x(t), y(t)], t = 0 .. j*sqrt(2)/50, x = -1 .. 1, y = -1 .. 1, init, thickness = 1, arrows = none, title = sprintf("Animace\n T = %4.4f",j*sqrt(2)/50), linecolor = [red, blue, gold, black])]), j=1..50),insequence=true);
Sorry, once
Sorry, once more:
restart;
with(DEtools):with(plots):
vx := diff(x(t), t) = -(x(t)-y(t))/sqrt(x(t)^2+y(t)^2);
vy := diff(y(t), t) = -(x(t)+y(t))/sqrt(x(t)^2+y(t)^2);
sys := {vx, vy}:
init := [[x(0) = 1, y(0) = 1], [x(0) = 1, y(0) = -1], [x(0) = -1, y(0) = -1], [x(0) = -1, y(0) = 1]]:
animate(DEplot, [sys, [x(t), y(t)], t = 0 .. T, x = -1 .. 1, y = -1 .. 1, init, stepsize = 0.1e-1, thickness = 1, arrows = none, title = "Animace", linecolor = [red, blue, gold, black]], T = 0.1e-2 .. sqrt(2));
animation of points
S:= [seq(subs(dsolve(sys union {op(v)}, numeric, output=listprocedure),[x(t),y(t)]),v=init)];OK, thank you. And when I
OK, thank you.
And when I want display trajectory as line and as point in one graph?
Combined
display([seq]( display([pointplot(S(j*sqrt(2)/50),colour=[red,blue,gold,black]), DEplot(sys, [x(t), y(t)], t = 0 .. j*sqrt(2)/50, x = -1 .. 1, y = -1 .. 1, init, thickness = 1, arrows = none, title = sprintf("Animace\n T = %4.4f",j*sqrt(2)/50), linecolor = [red, blue, gold, black])]), j=1..50),insequence=true);