Hello everybody
To be able to implement certain controllers in a microcontroller, I wanted to do the digitization with Mathematica. Preferably with the sample time as variable. As a test I chose a system where I already know the solution. In the microcontroller I need the coefficients of the LTI system (a and b values). I tried:
Fs2 = 1/(\[Tau]*s + 1)^2
Fz2 = ReplaceAll[Fs2, {s -> ((2/Ts)*((z - 1)/(z + 1)))}] //ExpandAll //Simplify
Solve[Fz2 == (b0 + b1*z^(-1) + b2*z^(-2))/(1 + a1*z^(-1) + a2*z^(-2)), {z, \[Tau], Ts }]
But I can't get very far with the code. Also with "SolveAlways" it does not give me a solution.
I also tested the function which seems to work:
Fs = TransferFunctionModel[{{{1}}, (\[Tau]*s + 1)^2}, s];
Fz = ToDiscreteTimeModel[TransferFunctionModel[Fs, s], Ts, z, Method -> "BilinearTransform"]
MyModel = CreateSystemModel[Fz];
MyModel["ModelicaDisplay"]
Nevertheless I wanted to solve the problem with the solver, so that I really understand what I am doing? How can I solve the problem with the solver?