How to set up a physical model optimisation scheme using Simscape Multibody and MATLAB?

9 vues (au cours des 30 derniers jours)
Shankhadeep
Shankhadeep le 5 Nov 2025 à 17:36
Réponse apportée : sneha le 10 Nov 2025 à 11:12
Well, I have been working on designing a robot and part of my study includes optimising the link lengths for energy usage and some parameter say 'x'. I have a working robot model and currently I am feeding pre-baked trajectories to the revolute joints of the model in Simscape. What I want to achieve is, I want to create a different MATLAB script which initialises all the design parameters and then starts the simulation with those parameter values. Once the desired parameter value 'x' has been achieved by the simulation, it should then feed that value back to the opimisation script. Now this script should use a cost function to minimise the energy usage through some genetic algorithm. It may use the simulation repeatatively to optimise the link lenghts. I'm not sure if anything of this structure is even possible to make, hence all kinds of suggestions are welcome. I'm new to Simscape and hence don't know a lot. Any help is appreciated.

Réponses (1)

sneha
sneha le 10 Nov 2025 à 11:12
Since there is no specific model or cost definition, I’ll assume:
  • You already have a working Simscape Multibody model that runs with given link lengths.
  • You can measure or compute total energy and any performance parameter (say x) from logged simulation signals.
Under these assumptions, a general workflow to set up a physical-model optimisation scheme is:
  1. Use MATLAB variables (like L1, L2, x_param) in your Simscape model for link lengths.
  2. Run the model from MATLAB using Simulink.SimulationInput so you can change parameters in a loop.
  3. After each run, pull out results (like energy or your parameter x).
  4. Write a cost function that updates parameters, runs the sim, and returns total energy or error.
  5. Use ga or another optimiser to minimise that cost.
Basically — make the model take MATLAB inputs, run it programmatically, measure performance, and let the optimiser tune your parameters automatically.
Supporting MathWorks Docs:

Catégories

En savoir plus sur Simulation and Analysis dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by