如何绘制一个螺旋函数及其内部函数?

如何绘制一个螺旋函数及其内部函数?

我正在尝试绘制一个看起来像这样的螺旋图......

在此处输入图片描述

它是 i(t) 内部函数 u_c(t) 的结果。

u_c(t) = 5 + exp(-1266.77*x) * (-5*cos(deg(5508.55*x)) + 10.3*sin(deg(5508.55*x)))
i(t) = exp(-1266.77*x) * (6.3*cos(deg(5508.55*x)) + 1.5*sin(deg(5508.55*x))

我可以绘制它们两个,但我无法绘制 i(t) 内的 u_c(t) 并使其看起来像示例......

任何帮助,将不胜感激。

这是我的 u_c(t) 和 i(t) 的代码以及我对 i(u_c(t)) 造成的混乱。

%%%u_c(t)
\begin{tikzpicture}
    \begin{axis}[
    title = {Verlauf der Kondensatorspannung nach Öffnen des Schalters},
    xlabel = {$t$ in s}, 
    ylabel= {$u_C(t)$ in V},
     xmin = 0, xmax = 0.0050,
     ymin = 0, ymax = 18,
    xtick distance = 0.0005,
    ytick distance = 2,
    grid = both,
    minor tick num = 1,
    major grid style = {lightgray},
    minor grid style = {lightgray!0.25},
    width = \textwidth,
    height = 0.5\textwidth]
        \addplot[
        domain = 0:0.005,
        samples = 300,
        smooth,
        thick,
        blue,] {5+exp(-1266.77*x)*(-5*cos(deg(5508.55*x))+10.3*sin(deg(5508.55*x)))};
 \end{axis}
\end{tikzpicture}


%%%i(t)

\begin{tikzpicture}
    \begin{axis}[
    title = {Verlauf des Gesamtstromes nach Öffnen des Schalters},
    xlabel = {t in s}, 
    ylabel= {$i(t)$ in mA},
     xmin = 0, xmax = 0.0050,
     ymin = -10, ymax = 10,
    xtick distance = 0.0005,
    ytick distance = 2,
    grid = both,
    minor tick num = 1,
    major grid style = {lightgray},
    minor grid style = {lightgray!0.25},
    width = \textwidth,
    height = 0.5\textwidth]
        \addplot[
        domain = 0:0.005,
        samples = 300,
        smooth,
        thick,
        orange,] {exp(-1266.77*5+exp(-1266.77*x)*(-5*cos(deg(5508.55*x))+10.3*sin(deg(5508.55*x))))*(6.3*cos(deg(5508.55*5+exp(-1266.77*x)*(-5*cos(deg(5508.55*x))+10.3*sin(deg(5508.55*x)))))+1.5*sin(deg(5508.55*5+exp(-1266.77*x)*(-5*cos(deg(5508.55*x))+10.3*sin(deg(5508.55*x)))))};
        
 \end{axis}
\end{tikzpicture}



%%%i(u_c(t))

\begin{tikzpicture}
    \begin{axis}[
    title = {Verlauf des Gesamtstromes nach Öffnen des Schalters},
    xlabel = {t in s}, 
    ylabel= {$i(t)$ in mA},
     xmin = 0, xmax = 0.0050,
     ymin = -10, ymax = 10,
    xtick distance = 0.0005,
    ytick distance = 2,
    grid = both,
    minor tick num = 1,
    major grid style = {lightgray},
    minor grid style = {lightgray!0.25},
    width = \textwidth,
    height = 0.5\textwidth]
        \addplot[
        domain = 0:0.005,
        samples = 300,
        smooth,
        thick,
        orange,] {exp(-1266.77*x)*(6.3*cos(deg(5508.55*x))+1.5*sin(deg(5508.55*x))};
        
 \end{axis}
\end{tikzpicture}

答案1

要获得像您所链接的参数图,您必须使用第一个函数作为 x 分量,并使用第二个函数作为 y 分量。

(u_C(t),i(t))

使用你的函数可以绘制函数对

({5+exp(-1266.77*x)*(-5*cos(deg(5508.55*x))+10.3*sin(deg(5508.55*x)))},
 {exp(-1266.77*x)*(6.3*cos(deg(5508.55*x))+1.5*sin(deg(5508.55*x))}
)

在此处输入图片描述

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}

\begin{tikzpicture}
    \begin{axis}[
    xlabel = {$u_C(t)$ in V}, 
    ylabel= {$i(t)$ in mA},
    xtick distance = 2,
    ytick distance = 2,
    grid = both,
    minor tick num = 1,
    major grid style = {lightgray},
    minor grid style = {lightgray!0.25},
    width = \textwidth,
    height = 0.5\textwidth]
        \addplot[
        domain = 0:0.005,
        samples = 300,
        smooth,
        thick,
        red,]
        ({5+exp(-1266.77*x)*(-5*cos(deg(5508.55*x))+10.3*sin(deg(5508.55*x)))},
         {exp(-1266.77*x)*(6.3*cos(deg(5508.55*x))+1.5*sin(deg(5508.55*x))}
        );
 \end{axis}
\end{tikzpicture}

\end{document}

相关内容