# TikZ, PGFPlots, or GNUplot: plotting a curve without the known function

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.

-
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 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 at 19:13
My point is you have to have something to plot, but that has nothing to with TeX. –  Joseph Wright Mar 29 at 19:22
This looks like the response of a controller, e.g. a PID controller. –  Psirus Mar 29 at 19:23
It is an under-damped oscillator which is commonly explained in RLC circuit or its mechanical dual. –  stalking is prohibited Mar 29 at 19:35

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

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}
\pstVerb
{
/xi .125 def
/tau .25 def
/rho {xi 2 exp neg 1 add sqrt} def
/amp 3 def
}
\def\f(#1){amp*(1-3^(-xi*(#1)/tau)*(cos((#1)*rho/tau)+sin((#1)*rho/tau)*xi/rho))}
\begin{document}
\begin{pspicture}[plotpoints=300](-1,-1)(11,7)
\psaxes[labels=none,ticks=none]{->}(0,0)(-1,-1)(10.5,6.5)[$t$,0][$v(t)$,90]
\psplot[algebraic,linecolor=blue,linewidth=2pt]{0}{10}{\f(x)}
\end{pspicture}
\end{document}


-

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
\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)
\normalfont%
\usepackage[T1]{fontenc}%  http://ctan.org/pkg/fontenc
\usepackage{textcomp}%  http://ctan.org/pkg/textcomp

\usepackage{pgfplots}
\pgfplotsset{compat = 1.9}
\pgfmathsetmacro\z{0.403713}
\pgfmathsetmacro\w{343.386319715305}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
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)$}
]

How can I change 1*10^{-2} to display as 0.01?
For your question, use scaled x ticks=false and x tick label style={/pgf/number format/fixed} in the axis options. –  Paul Gessler Mar 29 at 20:05