image1 image2 image3

HELLO I'M NGUYEN VAN THIEN|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I'M A MECHATRONICAL ENGINEER

Matlab: Some common function for Machatronic Engineer

1. Step - Step response plot of dynamic system

    This MATLAB function plots the step response of an arbitrary dynamic system
    model sys.

    step(sys)
    step(sys,Tfinal)
    step(sys,t)
    step(sys1,sys2,...,sysN)
    step(sys1,sys2,...,sysN,Tfinal)
    step(sys1,sys2,...,sysN,t)
    y = step(sys,t)
    [y,t] = step(sys)
    [y,t] = step(sys,Tfinal)
    [y,t,x] = step(sys)
    [y,t,x,ysd] = step(sys)
    [y,...] = step(sys,...,options)

2. Hold - Retain current plot when adding new plots

    This MATLAB function retains plots in the current axes so that new plots added
    to the axes do not delete existing plots.

    hold on
    hold off
    hold all
    hold
    hold(ax,'on')
    hold(ax,'off')
    hold(ax)
3. rlocus
 Here is an example of how the function rlocus works:
 Consider a randomly generated stable Transfer Function Model:
 of the form G(s)=num(s)/den(s):

num =

         0   -0.1022    0.0316    0.1934   -0.1795    0.1620


den =

    1.0000    6.2190   50.6538  222.7866  359.5180  162.7478

Call rlocus using the following command (see also, help rlocus):
rlocus(tf(num,den));

sgrid - Generate s-plane grid of constant damping factors and natural frequencies

    This MATLAB function generates, for pole-zero and root locus plots, a grid of
    constant damping factors from zero to one in steps of 0.1 and natural
    frequencies from zero to 10 rad/sec in steps of one rad/sec, and plots the grid
    over the current axis.

    sgrid
    sgrid(z,wn)


rlocfind  Find root locus gains for a given set of roots.

    [K,POLES] = rlocfind(SYS)  is used for interactive gain 
    selection from the root locus plot of the SISO system SYS 
    generated by RLOCUS.  rlocfind puts up a crosshair cursor 
    in the graphics window which is used to select a pole location 
    on an existing root locus.  The root locus gain associated 
    with this point is returned in K and all the system poles for 
    this gain are returned in POLES.  

    [K,POLES] = rlocfind(SYS,P)  takes a vector P of desired root 
    locations and computes a root locus gain for each of these 
    locations (i.e., a gain for which one of the closed-loop roots
    is near the desired location).  The j-th entry of the vector K
    gives the computed gain for the location P(j), and the j-th 
    column of the matrix POLES lists the resulting closed-loop poles.


Share this:

CONVERSATION

0 nhận xét:

Post a Comment