help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Control System Design methods using Octave.


From: shall689
Subject: Re: Control System Design methods using Octave.
Date: Wed, 6 Dec 2017 16:30:46 -0700 (MST)

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?

Stephen


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]