Translating from MATLAB to Simulink
Mostrar comentarios más antiguos
I have already written a MATLAB function and script to solve a large system of differential and alegraic equations. The original model uses ode15s to solve the stiff system of algebraic and differential equations. The equations also have several constants that are brought in to MATLAB from an Excel spreadsheet. I am now wanting to somehow incorporate this into Simulink so that I can do some parameter estimation/calibration. I have zero experience with Simulink. Is this the best method for performing parameter estimation? How do I go about "translating" my model as it currenlty exists to be run in Simulink for this purpose?
5 comentarios
Torsten
el 19 de Mayo de 2026 a las 20:11
If you have modelled your process in MATLAB by the system of differential and algebraic equations and you want to estimate parameters of this model against measurement data, you don't need Simulink. You can use MATLAB optimization functions, e.g. lsqcurvefit, for this.
Or do you want to extend your model by some physical blocks available in Simulink ?
Matthew
el 20 de Mayo de 2026 a las 16:48
Walter Roberson
el 20 de Mayo de 2026 a las 17:48
Do I understand correctly that you have a nonllnear model that has over 100 parameters, and each of them are unknown? Or are most of the parameters fixed in value and only a few are unknown?
Because if most of them are unknown, it is quite likely tthat lsqcurvefit will find misleading solutions. It is most common for nonlinear models to be quite sensitive to initial conditions.
For example something a simple as the sum of two phased guassians takes a lot of hunting around and frequently returns incorrect answers.
Matthew
el 20 de Mayo de 2026 a las 17:55
Harald
el 25 de Mayo de 2026 a las 8:27
Chiming in late...
You may find the problem-based approach easier to use than putting things into the format lsqcurvefit expects.
To get started with the problem-based approach: https://matlabacademy.mathworks.com/details/optimization-onramp/optim
Example for least-squares with problem-based approach: https://www.mathworks.com/help/optim/ug/nonlinear-least-squares-problem-based-basics.html
Best wishes,
Harald
Respuestas (0)
Categorías
Más información sobre General Applications en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!