I understand that when you have a Laplace function, you can do a bilinear or forward/backward Euler substitution for $s$ to phrase it in terms of $z^{-1}$. In a typical filter, $z^{-1}$ represents the input to the filter delayed by one sample.
But what about if it's something that's not really meant to be a filter? Ie. Something that's not really meant to get an input?
eg. Let's say you have the equation, which comes from work using the differentiation theory for Laplace transforms:
Where V=velocity, m=mass, v0= initial velocity, and R=impedance.
This can be phrased in terms of time as:
I understand how to use the time based version. You can simply run a timer from time 0 and add the sampling period to it each sample, and put that timer in for "t" to get the output each sample.
But what about the Laplace version? If you tried to sub in say a backward Euler $s=(1−z^{−1})/T$, what does $z^{-1}$ represent?
$V(z) = (m * v0) / (m * [(1−z^{−1})/T] + (2 * R))$
What now is $z^{-1}$? From a coding standpoint, what do I put into this equation for $z^{-1}$? ie. What do you delay by one sample and put back into the equation here?
ie. If you were writing this equation in C++, what would you write for the $z^{-1}$? Thanks.
Edit: I appreciate the answers but I think they're missing what I'm looking for so please let me rephrase:
I can code the simple time based equation like this:
velocity = v0 * exp ((-2 * R * timer)/mass);
timer = timer + (1/sampleRate);
And it will output velocity appropriately at each sample.
I am asking, how would I write some basic code to do the same with the z equation? I cannot understand what variable or data to put in for $z^{-1}$.
s = (1-z_1)/T;
velocity = (m * v0) / ((m * s) + (2*R));
Now in this code, what exactly is z_1?
Thanks again.

