Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Animation Gnuplot动画,Nbodies解算器_Animation_Gnuplot - Fatal编程技术网

Animation Gnuplot动画,Nbodies解算器

Animation Gnuplot动画,Nbodies解算器,animation,gnuplot,Animation,Gnuplot,我找了几个小时,巴德没有找到任何真正有用的东西来让一切正常工作 所以我得到了一个包含数据的txt文件 x1 y1 z1 x2 y2 z2 x3 y3 z3 x1' y1' z1' x2' y2' z2' x3' y3' z3' x1'' y1'' z1'' x2'' y2'' z2'' x3'' y3'' z3'' . . . x1^n y1^n z1^n x2^n y2^n z2^n x3^n y3^n z3^n 这意味着我有3颗行星,每个行星都有3d位置。在时间步长h之后,行星1(x

我找了几个小时,巴德没有找到任何真正有用的东西来让一切正常工作

所以我得到了一个包含数据的txt文件

x1 y1 z1
x2 y2 z2
x3 y3 z3

x1' y1' z1'
x2' y2' z2'
x3' y3' z3'

x1'' y1'' z1''
x2'' y2'' z2''
x3'' y3'' z3''

.
.
.
x1^n y1^n z1^n
x2^n y2^n z2^n
x3^n y3^n z3^n
这意味着我有3颗行星,每个行星都有3d位置。在时间步长h之后,行星1(x1,y1,z1)移动到(x1',y1',z1')

如何在GNUplot中可视化动画?我有N个时间步长和K个身体

谢谢您的帮助。

使用gif终端

planets.txt:

1 1 1
2 2 2
3 3 3

2 2 2
3 3 3
4 4 4

3 3 3
4 4 4
5 5 5

4 4 4
5 5 5
6 6 6

5 5 5
6 6 6
7 7 7

6 6 6
7 7 7
8 8 8

7 7 7
8 8 8
9 9 9

8 8 8
9 9 9
10 10 10

9 9 9
10 10 10
11 11 11

10 10 10
11 11 11 
12 12 12
planets.gp:

set term gif animate optimize delay 50 size 500,500
set output 'planets.gif'
set xrange [0:15]
set yrange [0:15]
set zrange [0:15]
unset key
unset colorbox
set palette rgb 3,11,6
do for [i=0:9] {                           
splot 'planets.txt' every :::i::i u 1:2:3 with points palette ps 3 pt 6 
}