Aid in Backward difference approximation

Thread Starter

Muhammad Salleh

Joined Oct 5, 2018
34
Hi Everyone on the forum,

I was given this images in the lecture and am trying to figure out the rules to apply to gain the equation. However, the lecture notes skipped steps and the equation suddenly showed up in that form. i tried to cross multiplying but am unsure how to proceed. Does Y(s)/[Ae^(-sL) = v(k-n)?


upload_2019-4-9_16-18-15.png

upload_2019-4-9_16-18-38.png

thank you in advance!
 

MrAl

Joined Jun 17, 2014
13,704
Hi Everyone on the forum,

I was given this images in the lecture and am trying to figure out the rules to apply to gain the equation. However, the lecture notes skipped steps and the equation suddenly showed up in that form. i tried to cross multiplying but am unsure how to proceed. Does Y(s)/[Ae^(-sL) = v(k-n)?


View attachment 174580

View attachment 174581

thank you in advance!

Hi,

That last equation 7.3 looks like the first two terms of a Taylor series approximation.
The factor h/(h+T) comes from replacing s in the filter function with their approximation with the q in it and letting q grow large.
They probably should have at least mentioned that AND they should have included the factor 'A' in the solution somewhere, somehow, which they never did either (obviously it is just a scaling factor).

To get a feel for how this should work and to test any result you get, separate the filter function from the delay factor, then use an inverse Laplace Transform in the usual way. Plot the time results, then imagine that everything you just plotted is shifted to the right by L. When you use your discrete result to compare you should see a similar wave shape.
The filter function is just a low pass filter so with a step input it will look like a capacitor charging, and with the delay factor included it will look like a cap charging only it wont start until after the delay period.

The attachment shows a test of the system using this approximation and a test of the same system using a z transform approach. You can see the outputs yk and yn are almost the same except in time (1 sample time difference because yn is not delayed) especially near the last samples. Since T=0.1 for the test, we can see that at the 10th sample the output yk or yn is nearly at the value for a continuous time system which would have been 1 time constant in time. We also see yk delayed by 1 sample from v. yn however is not delayed so to compare with yk we have to look back one sample.
Just to note, 1 more sample under yk would have yielded: 0.614457 which of course is the last value shown for v.
SampledSystemCompare_20190410.gif
 
Last edited:

MrAl

Joined Jun 17, 2014
13,704
Hello again,

Ok it turns out it is simpler than ever.

The trick is to handle the
q^-1
that is in:
(1-q^-1)/h

as an ordinary delay same as we would with a z transform. Doing that, we get the exact equation they show at the end.

If you want to try this yourself i will wait a while before posting the complete solution. If you have done these before it will be cake, but if not it may be confusing but i'll wait to see what you can do with this.
 

MrAl

Joined Jun 17, 2014
13,704
Hello again,

Ok here is the entire solution step by step...


Starting with the original:
Y(s)=A*e^(-s*L)*U(s)/(1+s*T)

we drop the 'A' because they did not include that in their solution.
Next separate the delay e^(-s*L) from the rest and get two expressions:
[1] v=U(s)/(1+s*T)
and
[2] y[k]=v[k-n]

Next we have the derivative approximation. If we start with the backward derivative approximation:
[3] dy/dt=(f(x)-f(x-h))/h (h the time increment)

we can turn that into digital:
[4] Dy/Dk=(y[k]-y[k-1])/h (h the sample time)

and this is equivalent to a form with a delay z1:
[5] Dy/Dk=y*(1-z1)/h

where a signal Phi is delayed by z1 as:
[6] Phi*z1

Now back to the first part of the expression part [1] above:
[7] v=U(s)/(1+s*T)

and simplify the notation a little bit:
[8] v=U/(1+s*T)

and replace s with the right hand side of [5] and get:
[9] v=(h*U)/(T+h-z1*T)

and now multiply both sides by the denominator of the right side and get:
[10] -v*z1*T+v*T+h*v=h*U

and here we see we have v appearing three times, and only one of those is multiplied by z1 so we
subtract that from both sides and get:
[11] v*T+h*v=h*U+v*z1*T

now factor for the v on the left and get:
[12] v*(T+h)=h*U+v*z1*T

now divide by (T+h) and get:
[13] v=(h*U+v*z1*T)/(T+h)

and expand the right and get:
[14] v=(h*U)/(T+h)+(v*z1*T)/(T+h)

and we see we have v delayed by one sample so this is equivalent to:
[15] v=(h*U)/(T+h)+(v[k-1]*T)/(T+h)

This is the final form although it does not look the same as in the text. To show this is the same we can either start with the text and simplify, or assume that this form has the same form and therefore it must contain a v[k-1] by itself with possibly other terms added. Thus going back to [14] for simplicity we can form the equation:
[16] (h*U)/(T+h)+(v*z1*T)/(T+h)=v*z1+x

and solve for x and get:
[17] x=(h*U-h*v*z1)/(T+h)

and so the entire expression becomes:
[18] v=v*z1+(h*U-h*v*z1)/(T+h)

and again replacing v*z1 with v[k-1] we get:
[19] v=v[k-1]+(h*U-h*v[k-1])/(T+h)

and factoring out the 'h' we get:
[20] v=v[k-1]+(U-v[k-1])*h/(T+h)

and since U and v are not delayed we replace with uk and vk and get:
[21] v[k]=v[k-1]+(u[k]-v[k-1])*h/(T+h)

and this is the same expression for 'v' as in the text.

The final delay is the e^(-s*L) part which brings us to:
[22] y[k]=v[k-L/h]

and that gives us the required yk.

The 'A' was left out of the final result in the text, but that would just mean multiplying the result by A.

Just for reference, z1 represents q^-1 in the text.
 
Last edited:
Top