|
From: | Doug Stewart |
Subject: | Re: Control System Design methods using Octave. |
Date: | Wed, 6 Dec 2017 19:06:19 -0500 |
I updated my code to use the 1/SampleFrequency in the tf() function. It
seems to give me much better results.
The code in my last post had n am m values for invfreqz() that were not
related to my previous post. I had been playing around with those values to
see if I could get a bode plot that was closer to the bode plot generated
from the PSIM simulation frequency sweep. The code below uses the n and m
values I had in my original code. How do I decide the n and m value --- by
trial and error?
pkg load control;
pkg load signal;
clear all
x = csvread('buckVfreqResp.csv');
SampleFrequency = 20000;
T = 1/SampleFrequency;
f = x(:,1);
r = x(:,2);
phase_rad = x(:,3).*(pi/180);
h = r.*cos(phase_rad) + r.*(sin(phase_rad)*i);
w = f.*(2*pi*T);
[b,a] = invfreqz(h,w,2,3)
sys = tf(b,a)
bode(sys)
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General- f1599825.html
_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |