我必须画出一个物体围绕中心物体旋转的速度矢量。这是开普勒的背景。物体的轨道由经典公式(r=p/(1+e*cos(theta))推导出,其中e=偏心率。
我设法画出了椭圆轨道,但现在,我想画出这个轨道上每一点物体的速度。
为了计算速度矢量,我从经典公式(转换为极坐标)开始,下面是两个分量:
v_r=d r/dt和v_theta=r d(theta)/dt
为了计算时间步长dt,我提取了与时间成正比的平均异常。
最后,我计算了速度向量的归一化。
clear % clear variables
e = 0.8; % eccentricity
a = 5; % semi-major axis
b = a*sqrt(1-e^2); % semi-minor axis
P = 10 % Orbital period
N = 200; % number of points defining orbit
nTerms = 10; % number of terms to keep in infinite series defining
% eccentric anomaly
M = linspace(0,2*pi,N); % mean anomaly parameterizes time
% M varies from 0 to 2*pi over one orbit
alpha = zeros(1,N); % preallocate space for eccentric anomaly array
%%%%%%%%%%
%%%%%%%%%% Calculations & Plotting
%%%%%%%%%%
% Calculate eccent