# How can I do summation in transfer function?

18 views (last 30 days)
larry liu on 25 Mar 2022
Commented: larry liu on 27 Mar 2022
s = tf('s');
sys_Foster = tf(R_Foster(1)/(1+R_Foster(1)*C_Foster(1)*s)+R_Foster(2)/(1+R_Foster(2)*C_Foster(2)*s)+R_Foster(3)/(1+R_Foster(3)*C_Foster(3)*s));
[N_tf,D_tf] = tfdata(sys_Foster);
If I have a transfer function like the code show
How can I perform sys_Foster not only summation for 3 terms but i terms, where i is size(R_Foster)
I have tried the code below
for i = 1:size(R_Foster)
sys_Foster_i(i) = tf(R_Foster(i)/(1+R_Foster(i)*C_Foster(i)*s))
end
sys_Foster = sum(sys_Foster_i)

Paul on 25 Mar 2022
One approach
R_Foster = 1:3;
C_Foster = 11:13;
sys_Foster = tf(0)
sys_Foster = 0 Static gain.
for ii = 1:3
sys_Foster = sys_Foster + tf(R_Foster(ii),[R_Foster(ii)*C_Foster(ii) 1])
end
sys_Foster = 1 -------- 11 s + 1 Continuous-time transfer function. sys_Foster = 46 s + 3 ------------------ 264 s^2 + 35 s + 1 Continuous-time transfer function. sys_Foster = 2586 s^2 + 268 s + 6 ------------------------------- 10296 s^3 + 1629 s^2 + 74 s + 1 Continuous-time transfer function.
sys_Foster
sys_Foster = 2586 s^2 + 268 s + 6 ------------------------------- 10296 s^3 + 1629 s^2 + 74 s + 1 Continuous-time transfer function.
larry liu on 27 Mar 2022
@Paul Thanks a lot! I got the answer I want. You really solve my problem. Really aprreciate.