File:Second order transfer function.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 631 × 356 pixels, file size: 80 KB)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description
    English: Step responses for a second order system defined by the transfer function:

    H(s)=ωn2s2+2ζωns+ωn2 where ζ is the damping ratio and ωn is the undamped natural frequency. The equations were obtained from here, plotted using maxima and edited in a text editor to insert the Greek alphabets in the plot. The equations are:

    1. hunder(t)=1−1β(ζ)e−ζωntsin⁡(β(ζ)ωnt+θ(ζ)),β(ζ)=1−ζ2,θ(ζ)=tan−1(β(ζ)ζ)
    2. hun(t)=1−cos⁡(ωnt)
    3. hcrit(t)=1−e−ωnt(1+ωnt)
    4. hover(t)=1+ωn2ζ2−1(e−s1ts1−e−s2ts2),s1=(ζ+ζ2−1)ωn,s2=(ζ−ζ2−1)ωn
    Date
    Source Own work
    Author Krishnavedala
    SVG development
    InfoField
     The SVG code is valid.
     This Unicode character was created with an unknown SVG tool.

    Source code

    The logo of Python – general-purpose programming language
    The logo of Python – general-purpose programming language
    This media was created with Python (general-purpose programming language) and NumPy (numerical programming package for the Python programming language) and Matplotlib (comprehensive library for creating static, animated, and interactive visualizations in Python)
    Here is a listing of the source used to create this file.

    Deutsch ∙ македонски ∙ English ∙ +/−

    from matplotlib.pyplot import *
    from numpy import *
    
    wt = linspace(0,15,100)
    b = lambda z: sqrt(1. - z**2)
    t = lambda z: arctan(b(z)/z)
    h1 = lambda wt,z: 1. - exp(-z*wt)*sin(b(z)*wt+t(z))/b(z)
    h2 = lambda wt: 1. - cos(wt)
    h3 = lambda wt: 1. - exp(-wt)*(1.+wt)
    s1 = lambda z: (z + sqrt(z**2-1.))
    s2 = lambda z: (z - sqrt(z**2-1.))
    h4 = lambda wt,z: 1. + ( (exp(-s1(z)*wt)/s1(z)) - \
    	(exp(-s2(z)*wt)/s2(z)) ) / (2.*sqrt(z**2-1.))
    
    fig = figure(figsize=(8,4))
    ax = fig.add_subplot(111)
    ax.grid(True)
    ax.plot(wt,h2(wt),'g',label=r"undamped $(\zeta=0)$")
    ax.plot(wt,h1(wt,.5),'b',label=r"under $(\zeta=0.5)$")
    ax.plot(wt,h3(wt),'r',label=r"critical $(\zeta=1.0)$")
    ax.plot(wt,h4(wt,1.5),'m',label=r"over $(\zeta=1.5)$")
    ax.set_ylim(0,2)
    ax.minorticks_on()
    
    leg = ax.legend(frameon=False,handletextpad=.05)
    setp(leg.get_texts(),fontsize=10)
    ax.set_xlim(0,15)
    ax.set_xlabel(r"$\omega t$",fontsize=15)
    ax.set_ylabel("Step response",fontsize=12)
    fig.savefig("Second_order_transfer_function.svg",bbox_inches="tight",\
    	pad_inches=.15)
    

    Source code

    The logo of Maxima – computer algebra system
    The logo of Maxima – computer algebra system
    This media was created with Maxima (computer algebra system)
    Here is a listing of the source used to create this file.

    Deutsch ∙ македонски ∙ English ∙ +/−

    beta(zeta) := sqrt(1-zeta^2);
    theta(zeta) := atan(beta(zeta)/zeta);
    h_under(wt) := 1 - beta(0.5)^-1*exp(-0.5*wt)*sin(wt*beta(.5)+theta(0.5));
    h_un(wt) := 1 - cos(wt);
    h_crit(wt) := 1 - exp(-wt) * (1+wt);
    s1(zeta) := zeta+sqrt(zeta^2-1);
    s2(zeta) := zeta-sqrt(zeta^2-1);
    h_over(wt) := 1 + ((exp(-s1(1.5)*wt)/s1(1.5))-(exp(-s2(1.5)*wt)/s2(1.5)))/(2*sqrt(1.5^2-1));
    load(draw);
    draw2d(dimensions=[800,400],terminal=svg,
      user_preamble="set mxtics; set mytics;",
      grid=true, yrange=[0,2], xlabel="omega t",
      line_width=1.5, ylabel="Step response",
      key="under (zeta=0.5)",color=blue,explicit(h_under(wt),wt,0,15),
      key="critical (zeta=1)",color=red,explicit(h_crit(wt),wt,0,15),
      key="over (zeta=1.5)",color=magenta,explicit(h_over(wt),wt,0,15),
      key="undamped (zeta=0)",color=green,explicit(h_un(wt),wt,0,15)
     );
    

    Licensing

    Krishnavedala, the copyright holder of this work, hereby publishes it under the following license:
    w:en:Creative Commons
    attribution share alike
    This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
    Attribution:
    You are free:
    • to share – to copy, distribute and transmit the work
    • to remix – to adapt the work
    Under the following conditions:
    • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
    • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    26 May 2011

    81,662 byte

    image/svg+xml

    04b6fdf2426038de1ef0ff4c33f6e86cb8a9c115

    File history

    Click on a date/time to view the file as it appeared at that time.

    Date/TimeThumbnailDimensionsUserComment
    current16:57, 7 June 2011Thumbnail for version as of 16:57, 7 June 2011631 × 356 (80 KB)wikimediacommons>Krishnavedalafigure correction after correcting the equations

    There are no pages that use this file.