How can I model the integrator show the desired reset behaviour?

1 次查看(过去 30 天)
Hi,
I want to model continuous behaviour with its input depending on the discrete behaviour which should be changing per sample time. An example is shown below.
I have the discrete part modelled as shown below.
Now I'm having trouble aligning the continuous part with this discrete part. There should be some reset coming from the discrete part. My current model is shown below with its combined scope plot for t=50.
Data:
I have initial value x0=[12;7.57] , gain A=[0.92 0.08 ; 0.15 0.85] , sample time ts=2 .
The pulse is period is sample time ts=2.
  1 个评论
Paul
Paul 2020-12-10
This model seems to be based on the assumption that for a discrete sequence x(k) governed by the difference equation
x(k+1) = A*x(k),x(0)=x0
that there is a continuous time solution between samples given by the equation
xdot(t) = A*x(t), t>=t(k), x(t(k)) = x(k)
The model posted above implements these two equations, but as you've noted it doesn't behave the way you expect. So the question is: why do you think these equations are correct for the process you want to model?
What would really be helpful is if you could explain the two light blue curves in the figure and how they relate to each other. I assume that the stair step curve is the solution to
x(k+1) = A*x(k) , x(0) = x0
But what is the other the light blue curve? Presumably it depends on the stair-step curve, but how? What is the mathematical relationship between them? Once that relationship is defined, it will be straightforward to model and simulate.
By the way, the posted model should be run with a much smaller step size to really see what's going on, maybe even use a variable step solver with a step size of 0.01

请先登录,再进行评论。

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2020-12-9
编辑:Fangjun Jiang 2020-12-9
I can say for sure that this is not an Integrator setting issue. For the blue curve, it looks like the response of a highly damped second order system. The stair curve is the input. The controller has an initial condition and then is able to follow the input with a typical second order system response. For the red curve, it is not clear what is the input and what is the ouput, although it also looks like the response of a second order system with a overshoot.
  1 个评论
DB
DB 2020-12-9
The red curve is one state modelled in discrete manner. I'm not sure what you mean with a damped second order system. This system is no physical system and has no damping and it is a first order system.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 General Applications 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by