I would like to make a plot of a function that has an overshoot of 25% and then settles with subtle oscillations at 100%. I would like to create it in one of the listed packages or in gnus case add on to PGFPlots. Unfortunately, I don't know the function I just have an image so I don't know how to start creating it.

enter image description here

  • 1
    Isn't that ultimately a problem of mathematics not TeX? Even if you can't find the function, you could presumably do a scan, work out the point positions and plot them.
    – Joseph Wright
    Mar 29 '14 at 19:07
  • @JosephWright I am not necessarily looking for an exact plot just something that has this behavior since we can always re label the axes. I think it may be possible to mimic this with TeX alone. I just don't know where or how to start without the equation.
    – dustin
    Mar 29 '14 at 19:13
  • 4
    My point is you have to have something to plot, but that has nothing to with TeX.
    – Joseph Wright
    Mar 29 '14 at 19:22
  • 1
    This looks like the response of a controller, e.g. a PID controller.
    – Psirus
    Mar 29 '14 at 19:23
  • 2
    It is an under-damped oscillator which is commonly explained in RLC circuit or its mechanical dual. Mar 29 '14 at 19:35

Just for a starting point. It is not a complete answer.

    /xi .125 def
    /tau .25 def
    /rho {xi 2 exp neg 1 add sqrt} def
    /amp 3 def

enter image description here


So I have been able produce the following:

\documentclass[tikz, convert = false]{standalone}
\usepackage[utf8]{inputenx}%  http://ctan.org/pkg/inputenx
% Euler for math | Palatino for rm | Helvetica for ss | Courier for tt
\renewcommand{\rmdefault}{ppl}% rm
\linespread{1.05}% Palatino needs more leading
\usepackage[scaled]{helvet}% ss //  http://ctan.org/pkg/helvet
\usepackage{courier}% tt // http://ctan.org/pkg/courier
\usepackage{eulervm}  %  http://ctan.org/pkg/eulervm
% a better implementation of the euler package (not in gwTeX)
\usepackage[T1]{fontenc}%  http://ctan.org/pkg/fontenc
\usepackage{textcomp}%  http://ctan.org/pkg/textcomp

\pgfplotsset{compat = 1.9}
    ymax = 1.3,
    ymin = 0,
    xmin = 0,
    xmax = .05,
    ytick = {0, 1.25},
    xtick = {0, 0.01},
    axis x line = center,
    axis y line = left,
    xlabel = {$t(sec)$},
    ylabel = {$y(t)$}
    \addplot[blue, samples = 100, smooth]
    gnuplot[id = exp, domain = 0:.05]
    {1 - exp(-\z*\w*x)/sqrt(1 - \z^2)*sin(\w*x*sqrt(1 - \z^2) + 1/cos(\z))};

enter image description here

How can I change 1*10^{-2} to display as 0.01?

  • 1
    For your question, use scaled x ticks=false and x tick label style={/pgf/number format/fixed} in the axis options. Mar 29 '14 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.