ZTransforms and Difference Equations?

05132020, 03:40 AM
Post: #1




ZTransforms and Difference Equations?
ZTransforms are a great tool for dealing with difference equations, for example:
y(n) = 2*x(n) + 3*x(n1) + 4*y(n) + 2*y(n1) However, I don't know how to type such a difference equation into the CAS. If I just try to define it as a function, the CAS warns me that I have a recursive definition, and goes into an infinite loop if I try to actually evaluate the ztransform. Somewhat relatedly, I noticed that simply taking the Z Transform of the Dirac function does not lead to a simple "1", but instead to sum(z^n * Dirac(n),n,0,inf) Which is just the direct application of the Z Transform, without any simplification. 

05132020, 02:40 PM
Post: #2




RE: ZTransforms and Difference Equations?
Yeah, I was never able to do that either. I think the ztrans() command can't handle difference equations, only expressions like e^(kT), Heaviside(k1), etc.
The inverse Z transform of 1 "invztrans(1,z,k)" returns the Kronecker delta, not Dirac, but "Kronecker(k)" doesn't seem to have any definition in the calculator. Maybe that's the reason it can't do the transform of impulse function? 

05132020, 07:06 PM
Post: #3




RE: ZTransforms and Difference Equations?
Playing around with it more, it seems what's missing here is the ability to declare, but not define, sequences. I.e. x and y in my example above are not functions (which would make x's definition above indeed recursive), but sequences.
If you could just tell the CAS that x and y are sequences, then ztrans(2*x(n) + 3*x(n1) + 4*y(n) + 2*y(n1),n,z) (omitting the "y(n) =" at the front) would, through the shift theorem, resolve to something like: ztrans(2*x(n)) + z^(1)*ztrans(3*x(n)) + ztrans(4*y(n)) + z^(1)*ztrans(2*y(n)) And that would be very nice already. Now, if you could also tell the CAS that, say, X is the ztransform of x, and Y is the ztransform of y, the expression could be further simplified to remove the "ztrans()"s. I don't suppose that possible? This kind of thing, i.e. declaring relations between functions/sequences/other objects without defining those objects, so that they stay symbolic, is something that I've wondered about before. In another thread, I asked about how to tell the CAS that F(x) is the indefinite integral/antiderivative of f(x) without defining f(x) to a specific function. 

05222020, 02:09 AM
Post: #4




RE: ZTransforms and Difference Equations?
So this is when the Kronecker delta was added to Xcas as the inverse Z transform of 1. The function itself still isn't defined in the Prime's cas though.
Any chance it could be added in the next update? 

« Next Oldest  Next Newest »

User(s) browsing this thread: