力螺旋轨迹

% Parameters
r_max = 1; % Maximum radius of the spiral
omega = 2 * pi; % Angular velocity (rad/s)
t_end = 10; % End time (s)
dt = 0.001; % Time step (s)
F_rz0 = 20; % Constant force in the z direction

% Time vector
t = 0:dt:t_end;

% Spiral trajectory equations
r = linspace(0, r_max, length(t)); % Radius increases linearly over time
f_rx = -r .* omega .* sin(omega .* t);
f_ry = r .* omega .* cos(omega .* t);
f_rz = F_rz0 * ones(size(t)); % Constant value along z-axis

% Plotting the force spiral
figure;
plot3(f_rx, f_ry, f_rz, 'b-', 'LineWidth', 1.5);
grid on;
xlabel('f_r_x (N)');
ylabel('f_r_y (N)');
zlabel('f_r_z (N)');
zlim([0 30])
title('Force Spiral Trajectory');
axis equal;

% Optional: Add markers to indicate direction
hold on;
scatter3(f_rx(1), f_ry(1), f_rz(1), 'ro', 'filled'); % Start point
scatter3(f_rx(end), f_ry(end), f_rz(end), 'go', 'filled'); % End point
legend('Spiral Trajectory', 'Start', 'End');



%%
% Parameters
r_max = 1; % Maximum radius of the spiral
omega = 2 * pi; % Angular velocity (rad/s)
t_end = 10; % End time (s)
dt = 0.001; % Time step (s)
z_increment = 0.5; % Increment of z per second

% Time vector
t = 0:dt:t_end;

% Spiral trajectory equations
r = linspace(0, r_max, length(t)); % Radius increases linearly over time
f_rx = -r .* omega .* sin(omega .* t);
f_ry = r .* omega .* cos(omega .* t);
f_rz = z_increment * t; % z increases linearly over time

% Plotting the force spiral
figure;
plot3(f_rx, f_ry, f_rz, 'b-', 'LineWidth', 1.5);
grid on;
xlabel('X (N)');
ylabel('Y (N)');
zlabel('Z (N)');
title('Spiral Trajectory');
axis equal;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值