From b48402adfef510ddd8dda3ff7eb48db57eadcd30 Mon Sep 17 00:00:00 2001 From: Atousa K Date: Fri, 4 Oct 2019 12:17:26 +0330 Subject: [PATCH 1/2] Convert tf to sym expression --- ControlSys/FeedbackLoopResponse.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ControlSys/FeedbackLoopResponse.m b/ControlSys/FeedbackLoopResponse.m index c5eed9b..7ddc3ce 100644 --- a/ControlSys/FeedbackLoopResponse.m +++ b/ControlSys/FeedbackLoopResponse.m @@ -1,8 +1,8 @@ % By: Johnathan Machler % Date: 01.23.19 -pkg load control -pkg load symbolic +% pkg load control +% pkg load symbolic G1 = tf([0 4], [0 1]); G2 = tf([0 1],[1 2]); @@ -12,5 +12,8 @@ rlocus(Sys); v=[-6 6 -6 6]; axis(v);axis('square');grid on; + +[Num,Den] = tfdata(Sys,'v'); syms s t -ilaplace(Sys, s, t) % Takes inverse laplace transform of symbolic expression +Sys_syms = poly2sym(Num,s)/poly2sym(Den,s); % Convert tf to symbolic expression +ilaplace(Sys_syms, s, t) % Takes inverse laplace transform of symbolic expression From d1bbeff0c343e9a5b5603966a99c26ad7677d670 Mon Sep 17 00:00:00 2001 From: Atousa K Date: Fri, 4 Oct 2019 12:35:07 +0330 Subject: [PATCH 2/2] correct comment structure --- ControlSys/PI_Controller.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ControlSys/PI_Controller.m b/ControlSys/PI_Controller.m index 7f6190d..26f727d 100644 --- a/ControlSys/PI_Controller.m +++ b/ControlSys/PI_Controller.m @@ -3,6 +3,6 @@ gc =tf([0.3 5 5],[1 0]); gp = tf([1],[0.01 0.11 0.1]); -ol = series(gc,gp); # Compensator/ Controller in series with plant +ol = series(gc,gp); %Compensator/ Controller in series with plant step(feedback(ol,1)) title('PID controller'); \ No newline at end of file