2012-03-11 71 views
0

我有一個關於在mathematica中的一個操作函數中一起使用繪圖和磁盤的問題。在mathematica中的繪圖中的磁盤

我有這樣一段代碼現在:

Plot[h[t], {t, 0, ttot}, PlotRange -> {0, 30}] 
Manipulate[ 
Plot[ 
    h0 + v0*t - 1/2*g*(t)^2, {t, 0, 10}, 
    PlotRange -> {{-1, 8}, {0, 11.5}} 
    ], 
{t, 0, ttot, 0.001}, {m, 0.001, 0.1, 0.001, ImageSize -> Tiny}, {v0, 
    0, 5, 0.01, ImageSize -> Tiny}, {h0, 0, 10, 0.01, ImageSize -> Tiny} 
] 

我想要做的是顯示代表一個飛行物體的情節裏的磁盤中(其位置是在曲線上,根據實際時間和高度)。我該怎麼做?

+1

歡迎StackExchange網絡!您可能有興趣在http://mathematica.stackexchange.com/上提出與Mathematica相關的問題,這是Mathematica最近發生的活動。 – Szabolcs 2012-03-11 13:31:43

回答

1

你應該告訴你使用符號的定義:h[t]v0ttot等 我的你是什麼樣的瞭解後:

trajectory[p0_, v0_, a_, t_] = p0 + v0 t - 1/2 a t^2; 

x0 = 3; 
v0y = 1; 
g = 9.81; 
ttot = 3; 

Manipulate[ParametricPlot[trajectory[{x0, h0}, {v0x, v0y}, {0, g}, t], {t, 0, ttot}, Epilog -> {Disk[trajectory[{x0, h0}, {v0x, v0y}, {0, g}, tcurrent], 0.5]}, PlotRange -> All], {v0x, 0, 5, 0.01}, {h0, 0, 10, 0.01}, {tcurrent, 0, ttot, 0.01}] 

Example

+0

謝謝,定義如下: – Smajl 2012-03-11 11:08:41

+0

g = 9.81; h0 = 0; v0 = 5; m = 10; (* velocity *) h [t_,v0_,h0_] = h0 + v0 * t-1/2 * g * =(1/g)*(v0 +((v0)^ 2 + 2 * g * h0)^ 0.5) – Smajl 2012-03-11 11:09:28