✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
Nature-Inspired Optimization Algorithms provides a systematic introduction to all major nature-inspired algorithms for optimization. The book's unified approach, balancing algorithm introduction, theoretical background and practical implementation, complements extensive literature with well-chosen case studies to illustrate how these algorithms work. Topics include particle swarm optimization, ant and bee algorithms, simulated annealing, cuckoo search, firefly algorithm, bat algorithm, flower algorithm, harmony search, algorithm analysis, constraint handling, hybrid methods, parameter tuning and control, as well as multi-objective optimization. This book can serve as an introductory book for graduates, doctoral students and lecturers in computer science, engineering and natural sciences. It can also serve a source of inspiration for new applications. Researchers and engineers as well as experienced experts will also find it a handy reference.
⛄ 部分代码
function sdot = quadEOM_readonly(t, s, F, M, params)
% QUADEOM_READONLY Solve quadrotor equation of motion
% quadEOM_readonly calculate the derivative of the state vector
%
% INPUTS:
% t - 1 x 1, time
% s - 13 x 1, state vector = [x, y, z, xd, yd, zd, qw, qx, qy, qz, p, q, r]
% F - 1 x 1, thrust output from controller (only used in simulation)
% M - 3 x 1, moments output from controller (only used in simulation)
% params - struct, output from nanoplus() and whatever parameters you want to pass in
%
% OUTPUTS:
% sdot - 13 x 1, derivative of state vector s
%
% NOTE: You should not modify this function
% See Also: quadEOM_readonly, nanoplus
%************ EQUATIONS OF MOTION ************************
% Limit the force and moments due to actuator limits
A = [0.25, 0, -0.5/params.arm_length;
0.25, 0.5/params.arm_length, 0;
0.25, 0, 0.5/params.arm_length;
0.25, -0.5/params.arm_length, 0];
prop_thrusts = A*[F;M(1:2)]; % Not using moment about Z-axis for limits
prop_thrusts_clamped = max(min(prop_thrusts, params.maxF/4), params.minF/4);
B = [ 1, 1, 1, 1;
0, params.arm_length, 0, -params.arm_length;
-params.arm_length, 0, params.arm_length, 0];
F = B(1,:)*prop_thrusts_clamped;
M = [B(2:3,:)*prop_thrusts_clamped; M(3)];
% Assign states
x = s(1);
y = s(2);
z = s(3);
xdot = s(4);
ydot = s(5);
zdot = s(6);
qW = s(7);
qX = s(8);
qY = s(9);
qZ = s(10);
p = s(11);
q = s(12);
r = s(13);
quat = [qW; qX; qY; qZ];
bRw = QuatToRot(quat);
wRb = bRw';
% Acceleration
accel = 1 / params.mass * (wRb * [0; 0; F] - [0; 0; params.mass * params.grav]);
% Angular velocity
K_quat = 2; %this enforces the magnitude 1 constraint for the quaternion
quaterror = 1 - (qW^2 + qX^2 + qY^2 + qZ^2);
qdot = -1/2*[0, -p, -q, -r;...
p, 0, -r, q;...
q, r, 0, -p;...
r, -q, p, 0] * quat + K_quat*quaterror * quat;
% Angular acceleration
omega = [p;q;r];
pqrdot = params.invI * (M - cross(omega, params.I*omega));
% Assemble sdot
sdot = zeros(13,1);
sdot(1) = xdot;
sdot(2) = ydot;
sdot(3) = zdot;
sdot(4) = accel(1);
sdot(5) = accel(2);
sdot(6) = accel(3);
sdot(7) = qdot(1);
sdot(8) = qdot(2);
sdot(9) = qdot(3);
sdot(10) = qdot(4);
sdot(11) = pqrdot(1);
sdot(12) = pqrdot(2);
sdot(13) = pqrdot(3);
end
⛄ 运行结果
⛄ 参考文献
[1] Agarwal D , Bharti P S . Comparison of Nature-Inspired Approaches for Path Planning Problem of Mobile Robots in MATLAB[J]. 2022.
[2] 黄鼎勇, 周芳, 路遥,等. 基于冲突搜索的数字战场多无人机路径规划与仿真[J]. 指挥信息系统与技术, 2022(004):013.
[3] 邓敏, 陈志. 基于k度平滑的多无人机协调路径规划方法[J]. 计算机工程与设计, 2021, 042(008):2387-2394.
[4] 陈海, 何开锋, 钱炜祺. 多无人机协同覆盖路径规划 优先出版[J]. 航空学报, 2016.
[5] 马云红, 周德云. 无人机路径规划算法与仿真[J]. 火力與指揮控制, 2007, 32.