Você está na página 1de 8

>> %LCV''+RCV'+V=Vi [1 0;0 lc]x'=[0 1;-1 -rc]x+[0 1)u----->x=[V V']........

[c o;ol]x'=[0 1;-1 -R]x+[0 1]u ---->x=[V I] >> % L=10mH,C=2uF, R=.3kOmhs >> help ss SS Creates state-space model or converts model to state space. SYS = SS(A,B,C,D) creates a SS object SYS representing the continuous-time state-space model dx/dt = Ax(t) + Bu(t) y(t) = Cx(t) + Du(t) You can set D=0 to mean the zero matrix of appropriate dimensions. If one or more of the matrices A,B,C,D have uncertainty, SS returns an uncertain state-space (USS) model (Robust Control Toolbox only). SYS = SS(A,B,C,D,Ts) creates a discrete-time state-space model with sample time Ts (set Ts=-1 if the sample time is undetermined). SYS = SS creates an empty SS object. SYS = SS(D) specifies a static gain matrix D. In all cases above, the input list can be followed by pairs 'PropertyName1', PropertyValue1, ... that set various model properties (see LTIPROPS for details). You can create arrays of state-space models by using ND arrays for A,B,C,D. The first two dimensions of A,B,C,D define the number of states, inputs, and outputs, while the remaining dimensions specify the array sizes. For example, sys = ss(rand(2,2,3,4),[2;1],[1 1],0) creates a 3x4 array of SISO state-space models. You can also use indexed assignment and STACK to build SS arrays: sys = ss(zeros(1,1,2)) % create 2x1 array of SISO models sys(:,:,1) = rss(2) % assign 1st model sys(:,:,2) = ss(-1) % assign 2nd model sys = stack(1,sys,rss(5)) % add 3rd model to array SYS = SS(SYS) converts a system SYS of arbitrary class to state space, that is, computes a state-space realization of SYS. SYS = SS(SYS,'min') computes a minimal realization of SYS. SYS = SS(SYS,'explicit') computes an explicit realization (E=I) of SYS. An error is thrown if SYS is improper. See also ltimodels, ltiprops, dss, delayss, rss, drss, lti/ssdata, tf, zpk, frd.

Overloaded methods: lti/ss idmodel/ss idfrd/ss mpc/ss umat/ss atom/ss dfilt.ss Reference page in Help browser doc ss >> L=10e-3 L= 0.0100 >> L=2e-6 L= 2.0000e-006 >> C=2e-6 C= 2.0000e-006 >> clean L ??? Undefined function or method 'clean' for input arguments of type 'char'. >> clear L >> L=10e-3 L= 0.0100 >> R=.3e3 R= 300 >> >> At1 = [0 1;-1 -R*C]; At2=[0 1; -1 -R];

>> Bt = [0 1]; >> Cy = [1;0]; >> Bt = [0;1]; >> sys1 = ss(T1\At1,T1\Bt,Cy',0) %\ sacar ala inversa a= x1 x2 x1 0 1 x2 -5e+007 -3e+004 b = T1=[1 0;0 L*C]; T2=[C 0;0 L]; u1 x1 0 x2 5e+007 c= x1 x2 y1 1 0 d= u1 y1 0 Continuous-time model. >> sys2 = ss(T2\At2,T2\Bt,Cy',0) %\ sacar ala inversa a= x1 x2 b= u1 x1 0 x2 100 c= x1 x2 y1 1 0 d= u1 y1 0 Continuous-time model. >> impulse(sys1,sys2) >> grid >> step(sys1,sys2) x1 x2 0 5e+005 -100 -3e+004

>> grid >> [u,t] = gensig('square',8e-3,32e-3,0.1e-3); >> lsim(sys2,u,t) >> 1/8e-3 ans = 125 >> %(tipo, periodo(en poco mas del doble de lo tardado en estabilizarce,no. periodos,el incremento en la misma escala(mili segundos)); >> sbplot(2,1,2)) ??? sbplot(2,1,2)) | Error: Unbalanced or unexpected parenthesis or bracket. >> subplot(2,1,2) >> lsim (sys2,u,t) >> step(sys2) >> subplot(2,1,2) >> lsim(sys2,u,t) >> step(sys2) >> subplot(2,1,2) >> lsim(sys2,u,t) >> Gp1=tf(sys1) Transfer function: 5e007 --------------------s^2 + 3e004 s + 5e007 >> Gp2=tf(sys2) Transfer function: 5e007 --------------------s^2 + 30000 s + 5e007 >> %que tipo de sistemas es? sobreamortiguado >> %Analisis en frecuencia >> help bode BODE Bode frequency response of LTI models. BODE(SYS) draws the Bode plot of the LTI model SYS (created with either TF, ZPK, SS, or FRD). The frequency range and number of points are chosen automatically.

BODE(SYS,{WMIN,WMAX}) draws the Bode plot for frequencies between WMIN and WMAX (in radians/second). BODE(SYS,W) uses the user-supplied vector W of frequencies, in radian/second, at which the Bode response is to be evaluated. See LOGSPACE to generate logarithmically spaced frequency vectors. BODE(SYS1,SYS2,...,W) graphs the Bode response of multiple LTI models SYS1,SYS2,... on a single plot. The frequency vector W is optional. You can specify a color, line style, and marker for each model, as in bode(sys1,'r',sys2,'y--',sys3,'gx'). [MAG,PHASE] = BODE(SYS,W) and [MAG,PHASE,W] = BODE(SYS) return the response magnitudes and phases in degrees (along with the frequency vector W if unspecified). No plot is drawn on the screen. If SYS has NY outputs and NU inputs, MAG and PHASE are arrays of size [NY NU LENGTH(W)] where MAG(:,:,k) and PHASE(:,:,k) determine the response at the frequency W(k). To get the magnitudes in dB, type MAGDB = 20*log10(MAG). For discrete-time models with sample time Ts, BODE uses the transformation Z = exp(j*W*Ts) to map the unit circle to the real frequency axis. The frequency response is only plotted for frequencies smaller than the Nyquist frequency pi/Ts, and the default value 1 (second) is assumed when Ts is unspecified. See also bodemag, nichols, nyquist, sigma, freqresp, ltiview, ltimodels. Overloaded methods: lti/bode idmodel/bode idfrd/bode uss/bode ultidyn/bode ufrd/bode Reference page in Help browser doc bode >> bode (sys2) >> bode(sys2) >> grid >> bode(sys2) >> grid >> bode(sys2) >> grid >> help logspace

LOGSPACE Logarithmically spaced vector. LOGSPACE(X1, X2) generates a row vector of 50 logarithmically equally spaced points between decades 10^X1 and 10^X2. If X2 is pi, then the points are between 10^X1 and pi. LOGSPACE(X1, X2, N) generates N points. For N < 2, LOGSPACE returns 10^X2. Class support for inputs X1,X2: float: double, single See also linspace, :. Reference page in Help browser doc logspace >> frecuencias=logspace (0,3,21) frecuencias = 1.0e+003 * Columns 1 through 14 0.0010 0.0014 0.0020 0.0028 0.0040 0.0056 0.0079 0.0112 0.0158 0.0224 0.0316 0.0447 0.0631 0.0891 Columns 15 through 21 0.1259 0.1778 0.2512 0.3548 0.5012 0.7079 1.0000 >> figure >> semilogy(frecuencias,'DispayName','frecuencia') ??? Error using ==> semilogy Invalid property found. Object Name : line Property Name : 'DispayName'. >> semilogy(frecuencias,'DispayName','frecuencia'); ??? Error using ==> semilogy Invalid property found. Object Name : line Property Name : 'DispayName'. >> semilogy(frecuencias,'DisplayName','frecuencia') >> grid >> figure >> nyquist(sys2)

>> grid >> figure >> nichols(sys2) >> grid >> figure >> pzmap(sys2)

>> Gp3=tf([1],[4 3 2]) Transfer function: 1 --------------4 s^2 + 3 s + 2 >> lsim (Gp3,u,t) >> step(Gp3) >> bode (Gp3) >> grid >> nyquist(Gp3) >> figure >> bode (Gp3) >> grid >> figure >> nyquist(Gp3) >> grid >> figure >> nichols(Gp3) >> grid >> figure >> pzmap(Gp3) >> Gp4=tf([1],[6 5 4 3]) Transfer function: 1 ----------------------6 s^3 + 5 s^2 + 4 s + 3 >> lsim (Gp4,u,t) >> bode (Gp4) >> grid >> figure >> nyquist(Gp4) >> grid >> figure nichols(Gp3) grid

>> nichols(Gp3) >> grid >> figure >> pzmap(Gp4) >> >> L=10e-3 L= 0.0100 >> R1=0.1e-3 R1 = 1.0000e-004 >> R2=0.2e-3 R2 = 2.0000e-004 >> R3=0.3e-3 R3 = 3.0000e-004 >> C1=1e-6 C1 = 1.0000e-006 >> C2=2E-6 C2 = 2.0000e-006 >> T1=[R1*C1 0 L;0 C2*R2 -L;C1 -C2 0]; >> B1=[1;0;0]; >> CT=[1 0 0;0 1 0;0 0 R3]; >> At1 = [-1 0 -R3;0 -1 R3;0 0 1]; >> T1=[R1C1 0 L;0 C2*R2 -L;C1 -C2 0];

Você também pode gostar