
¿Sería posible lograr esto en parcelas PGF? Puedo lograr obtener una onda sinusoidal y dibujar la onda con forma de diente de sierra, pero no puedo unirlo todo.
Respuesta1
Otra forma de implementar la gráfica de Jesse sin usar bucles es usar abs(sin(x))
para la onda sinusoidal rectificada, exp(-(0.0015*mod(x+90,180))
para la función exponencial repetitiva y max(<function a>, <function b>)
para combinar las dos:
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
domain=0:1.5*360,
samples=4*360,
xtick=\empty,
width=10cm, height=4cm,
ymin=0,
enlarge x limits=false
]
\addplot [densely dashed] {abs(sin(x))};
\addplot [very thick] {max(abs(sin(x)), exp(-(0.0015*mod(x+90,180)))};
\end{axis}
\end{tikzpicture}
\end{document}
Respuesta2
Esta es una posible solución mediante PGFplots. La curva rectificada es una función de caída exponencial con una constante de tiempo grande, no una línea inclinada.
Código
\documentclass{article}
\usepackage{pgfplots}
\usepackage{graphicx}
\begin{document}
\def\arch{1.7*pi/3} %
\begin{figure}[!hbt]
\centering
\begin{tikzpicture}
\begin{axis}[xlabel={$t$},xmin=-3,xmax=21,
ylabel={$i_D$},ymin=0,ymax=5,
axis x line=center,
axis y line=left, enlargelimits=upper]
% draw sine functions
\addplot [dashed,thin,domain=-pi:6*pi,smooth]{-2*sin(deg(0.5*x))};
\addplot [dashed,thin,domain=-pi:6*pi,smooth]{ 2*sin(deg(0.5*x))};
% draw the rectified curves automatically via foreach skill
\foreach \i/\j/\k in {-1/0/1,1/2/3,3/4/5,5/6/7}{
\addplot [thick,domain=\i*pi:{\j*pi+\arch}, ] {2*e^(-0.05*(x-\i*pi)}; % exponentially decay curves, not a line
\addplot [thick,domain={\j*pi+\arch}:\k*pi, smooth]{ 2*sin(deg(0.5*x))};
\addplot [thick,domain={\j*pi+\arch}:\k*pi, smooth]{-2*sin(deg(0.5*x))};
}
\end{axis}
\end{tikzpicture}
\caption{Half-Wave Rectifier Waveform}
\label{halfcycle}
\end{figure}
\end{document}