Mathematica Version 14.0 on Win 10.
This is a problem I am having with a much more complicated notebook. I crafted the simple example below for this question.
If I begin with an expression in the s-domain, create a continuous time model, and then convert that to a discrete time model using ToDiscreteTimeModel, and specify a symbolic parameter T for the sampling period. Then T appears in the model expression and as the subscript on the model icon. I can then evaluate this model at different sampling periods by using Replace with a Rule for T.
However, if I begin with an expression in the z-domain and create a discrete time model using TransferFunctionModel, with the option SamplingPeriod->T, then T does not appear in the model expression, but does appear as the subscript of the model icon. In this case, using Replace with a Rule for T, assigning a value to T, the model icon subscript changes, but it does not affect the behavior of the model.
The code below attempts to obtain the OutputResponse of the second case for different sampling periods, but changing the value of T has no effect.
There must be something I don't understand or some way in which I am thinking incorrectly.
(*start in the s-domain*)
gs = 10/(s + 10);
(*build a continuous time transfer function*)
gst = TransferFunctionModel[gs, s];
(*convert to discrete and the sampling period T appears in the \
expression*)
gstz = ToDiscreteTimeModel[gst, T, z]
(*start in the z-domain*)
gz = z/(z - 1);
(*build a discrete transfer function*)
(*T does not appear in the expression. It only appears in the \
subscript*)
gzt = TransferFunctionModel[gz, z, SamplingPeriod -> T]
(*apply a rule to define the sampling period and the subscript \
changes*)
gzt /. T -> .1
OutputResponse[gzt /. T -> .1, {1, 1, 1, 1, 1}]
(*{{1,2,3,4,5}}*)
(*change to a different sampling period and the output does not \
change*)
OutputResponse[gzt /. T -> .01, {1, 1, 1, 1, 1}]
(*{{1,2,3,4,5}}*)