I am sorry that I make a mistake that sys1+sys2=(2s+2)/(s^2+2s+1).it seems that it's same as 2*sys,but its (sys1+sys2).a is 2*2,it means that (2s+2)/(s^2+2s+1) is different from 2/s+1 with system.A .
How to achieve the unification of addition and multiplication in state space models
47 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
kang
le 30 Nov 2024 à 5:55
Modifié(e) : Pavl M.
le 30 Nov 2024 à 13:35
for example,sys=1/(s+1),I have a test,sys1+sys1=2s/(s^2+2s+1),but 2*sys=2/(s+1),so which I should choose? and now I want to calculate 1/2 *sys,maybe a fraction 1.5,hope to get your help :)
Réponse acceptée
Pavl M.
le 30 Nov 2024 à 13:34
Modifié(e) : Pavl M.
le 30 Nov 2024 à 13:35
clc
clear all
close all
%Algebraic help:
%sys = 1/(s+1)
%2s/(s^2+2*s+1) = 2*s/(s+1)(s+1) = s/(s+1)(s+1) + s/(s+1)s+1)
%(2*s+2)/(s^2+2*s+1) = 2*(s+1)/(s+1)(s+1) = 2/(s+1)
%You need to show that (2*s+2)/(s^2+2*s+1) = 2*sys
num1 = 1;
den1 = [1,2];
sys1 = tf(num1,den1)
sys1 = tf(num1, den1)
sys2 = 2*sys1
sys2 = tf(2*num1,den1)
num3 = [2 2]
den3 = [1 2 1]
sys3 = tf(num3,den3)
minreal(sys3)
s = tf( 's' )
sys4 = 2/(s+1)
sys5 = (2*s+2)/(s^2+2*s+1)
sys4.numerator
sys4.denominator
sys6 = minreal(sys4)
if norm(sys4 - sys6,inf) == 0
display('Transfer functions are equal')
else
tf(zpk(sys4)) - tf(zpk(sys6))
sys4/sys6
disp('They differ')
end
%if all(cell2mat(sys6.numerator) == cell2mat(sys4.numerator)) && all(cell2mat(sys6.denominator) == cellmat(sys4.denominator))
% display('OK')
%end
%Constructed by
%https://independent.academia.edu/PMazniker
%+380990535261, https://join.skype.com/invite/oXnJhbgys7oW
%https://diag.net/u/u6r3ondjie0w0l8138bafm095b
%https://github.com/goodengineer
%https://orcid.org/0000-0001-8184-8166
%https://willwork781147312.wordpress.com/portfolio/cp/
%https://www.youtube.com/channel/UCC__7jMOAHak0MVkUFtmO-w
%https://nanohub.org/members/130066
%https://pangian.com/user/hiretoserve/
%https://substack.com/profile/191772642-paul-m
%kindly accept my the answer-solution.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Stability Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!