Identical blocks in Simulink with identical inputs from different sources results in different solutions
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
While debugging a model-based controller on a system, I came across the following situation:
I have two identical blocks, each defining a nonlinear, 2nd order continuous system model (it's a pendulum) xdot = f(x,u). The blocks output xdot, which is hooked to an integrator that is looped back around so that the next simulation step can get the updated state x in f(x,u). However, one block gets u = u1 from the controller output, and one gets it from a "Repeating Sequence Stair" block that contains the same command to the plant, u = u2, that the controller outputs (saved from a previous simulation). I've output the inputs to each block and shown definitively that u1 = u2, so as far as I can tell, the systems should be identical; they just get their inputs from different sources.
However, that's not true; instead, the solutions are completely different. I'm using a fixed time-step with a Runge-Kutta (ode4) solver. I've tried other solvers and it doesn't seem to affect the result. I'd really like to know how this is possible.
See this picture http://tinypic.com/r/33n9c0o/6 in lieu of the actual model. The plant input sources are in red, the blocks containing continuous model definitions are in blue, and the states/integrators corresponding to continuous model are in green (so the conflicting outputs are Position and Position1). There's a lot of other stuff but it's also all identical between the blocks and related to the discrete models anyway (i.e. not this issue).
0 comentarios
Respuestas (2)
Guy Rouleau
el 6 de Mzo. de 2013
Are the colors in your image sample time colors? If yes, do you have the same response using ode1 solver?
If ode1 solver gives same response, then use this central submission to understand the effect of minor steps:
Another you might want to try is reduce the step size of the fixed-step solver to ensure the dynamics of your system is slower than the solver step size.
0 comentarios
Hannes
el 7 de Mzo. de 2013
1 comentario
Guy Rouleau
el 8 de Mzo. de 2013
My main concern was that you model was mixing continuous sample with "fastest disctere(D1)" at the same rate. This can lead to oscillations in the minor steps. But if the phenomenon you observe still appear with ode1, then we rule that out because ode1 does not have minor steps.
With the information provided, I am running out of idea...
Ver también
Categorías
Más información sobre General Applications en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!