Off late I have been posting a lot of problems based on the general dynamic system of the form:
x˙=x+u
Here, x=x(t) represents a time-dependent quantity of the system whereas u=u(t) is a time-varying input meant to excite the system. The behaviour of this system is captured using the differential equation described above. This note describes how to convert a differential equation to a discrete-time difference equation.
Consider the differential equation:
x˙−x=u
Multiplying both sides by e−t gives:
e−tx˙−e−tx=e−tu
This can be simplified to:
dtd(e−tx)=e−tu
Or:
d(e−tx)=ue−tdt
Given that the initial condition of the system is x(0)=xo, integrating both sides:
∫xoxe−td(e−tx)=∫0tu(s)e−sds
Which is:
xe−t−xo=∫0tu(s)e−sds
Implies:
x(t)=xoet+et∫0tu(s)e−sds
Consider a general time t1=T and another time instant t2=T+h, where h represents a small time step.
x(T)=xoeT+eT∫0Tu(s)e−sds
x(T+h)=xoe(T+h)+e(T+h)∫0T+hu(s)e−sds
Which can be written as:
x(T+h)=xoe(T+h)+e(T+h)∫0Tu(s)e−sds+e(T+h)∫TT+hu(s)e−sds
Or,
x(T+h)=eh(xoe(T)+e(T)∫0Tu(s)e−sds)+e(T+h)∫TT+hu(s)e−sds
Recognising that the term in the bracket multiplied by eh is x(T) gives:
x(T+h)=ehx(T)+∫TT+hu(s)e(T+h−s)ds
Addressing the remaining integral: Taking T+h−s=z, plugging into the integral, manipulating and simplifying gives:
x(T+h)=ehx(T)+∫0hu(T+h−z)ezdz
The only assumption made in this entire analysis is that x(T) and u(T) are held constant in the interval [T,T+h) . In other words, u(T+h−z)=u(T) as z varies from 0 to h. This leads to:
x(T+h)=ehx(T)+(∫0hezdz)u(T)
In other words:
x(T+h)=ax(T)+bu(T)
Where: a=eh and b=∫0hezdz
So, in summary, this analysis shows the conversion of a differential equation to a discrete-time difference equation.
x˙=x+u
Is equivalent to, in discrete time:
x(T+h)=ax(T)+bu(T)
Where: a=eh and b=∫0hezdz
Now, an example is presented to illustrate this process:
Consider the equation:
x˙=x+u
Here, x(0)=0 and u(t)=1 is a constant input. This differential equation is converted to a discrete difference equation and both systems are simulated. The plots show the response of this system for various time steps h. In the first plot, h=0.1 s. In the second plot, h=0.05 s. In the third plot, h=0.01 s. In the fourth plot, h=0.001 s.
So one can see that h reduces, the discrete-time response comes closer to that of the continuous-time response.
The results derived for a specific dynamic system in this note can be generalized for any linear dynamic system in any number of dimensions. An interested reader may attempt to do so and post his/her comments on this subject.
#Calculus
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
It's interesting that you introduced exponentials into this. My basic intuition would have been:
x˙=x+ux(T+h)=x(T)+hx˙(T)x(T+h)=x(T)+h(x(T)+u(T))x(T+h)=x(T)(1+h)+hu(T)
Of course, as we know from numerical integration in general, there are a variety of ways to do the computations. With a sufficiently small step-size, they should all basically agree.
Log in to reply
Hello! It is true that approximating the derivative is a more straightforward approach to discretization. You rightly pointed out that there exist many approaches to go about this operation and that with a sufficiently small step size, the response would be indistinguishable with the continuous-time response.
A good way to compare these methods is by doing so in the frequency domain. Certain methods lead to a discrete system which approximates the frequency response better than other discretization methods.
The method described in this note is in fact, not the best approach when one considers frequency domain responses. It is an interesting approach though.
Log in to reply
I was thinking about that. This reminds me of the 2-tap vs 3-tap differentiator exercise. Would you like to post a problem comparing the frequency response of your method vs. the Euler-style approach?
Log in to reply
Log in to reply