Memuat
Memuat
Particle Swarm (particleswarm) for Robotics and Mechatronics
0 views
Optimise the mean tracking error with particle swarm by tuning the proportional gain and the derivative gain within realistic constraints. particleswarm solves global optimisation with a swarm of particles without needing derivatives. It suits continuous non-smooth objectives, model parameter tuning, and design problems with variable bounds.

Optimise the mean tracking error with particle swarm by tuning the proportional gain and the derivative gain within realistic constraints.
| Role | Variable | Unit |
|---|---|---|
| Main | Mean tracking error | m |
| Supporting 1 | Proportional gain | - |
| Supporting 2 | Derivative gain | - |
Particle swarm converges to Proportional gain=1.211 and Derivative gain=0.722 with objective Mean tracking error=0.000 in 60 iterations (1830 evaluations); the swarm mean falls to 0.000.
Computed from illustrative synthetic data, not from a real study.
particleswarm solves global optimisation with a swarm of particles without needing derivatives. It suits continuous non-smooth objectives, model parameter tuning, and design problems with variable bounds.
Report swarm size, iterations, best solution and objective, and variation across runs. Compare with ga or fmincon where relevant.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
mean_tracking_error = @(x) (x(1)^2 + x(2) - 11)^2 + (x(1) + x(2)^2 - 7)^2; % Himmelblau
lb = [-5 -5]; ub = [5 5];
opts = optimoptions('particleswarm', 'SwarmSize', 60, 'MaxIterations', 150, ...
'Display', 'off', 'FunctionTolerance', 1e-12);
nrun = 5; best = zeros(nrun, 1); sols = zeros(nrun, 2);
for r = 1:nrun
rng(r);
[sols(r,:), best(r)] = particleswarm(mean_tracking_error, 2, lb, ub, opts);
end
fprintf('Best values: %s\n', mat2str(best', 3));
fprintf('Solutions:\n'); disp(sols);
proportional_gain = sols(1, :);
[g1, g2] = meshgrid(linspace(-5, 5, 200));
Z = (g1.^2 + g2 - 11).^2 + (g1 + g2.^2 - 7).^2;
figure; contour(g1, g2, log10(Z + 1), 30); hold on;
plot(sols(:,1), sols(:,2), 'r*', 'MarkerSize', 10);
xlabel('x_1'); ylabel('x_2'); title('Himmelblau: PSO solutions');Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$34
excl. 11% VAT
Duration: 7 working days
Output: MATLAB files + result figures
Deliverables
Package 2 · most chosen
US$100
excl. 11% VAT
Duration: 13 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$222
excl. 11% VAT
Duration: 18-21 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Particle Swarm (particleswarm) is commonly used at this level in Robotics and Mechatronics. We adapt the analysis to your research question, your own data and your supervisor's requirements.
No. The sheet is computed from illustrative synthetic data so you can see the kind of output MATLAB gives. For your order we run the same method on your own data.
That is the point of the packages. Every script is commented, and Package 3 includes two coaching sessions plus practice questions so you can explain the method and the results at your seminar and defence.
Each project has three packages: Package 1 (code and explanation) US$34, Package 2 (your data analysis and interpretation) US$100 and Package 3 (full guidance) US$222, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. MATLAB is a trademark of The MathWorks, Inc.
Back to MATLAB portfolio