[pstricks] Function of the current in a coil

Thomas Söll Thomas.Soell at lehrer.uka.de
Thu Feb 24 19:09:02 CET 2011


Hallo,

I hope the linebreaks work now. The sourcecode is in the attachment as pdf 
to.

\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{ngerman}
\usepackage{fancyhdr}
\usepackage{amsmath,amsthm}
\usepackage{enumerate}
\usepackage{calc}         % From LaTeX distribution
\usepackage{multido}      % From PSTricks
\usepackage{array}
\usepackage[dvips]{graphics}
\usepackage[dvips]{changebar}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pst-node}
\usepackage{pst-osci,pst-circ}
\usepackage{pst-poly}     % From pstricks/contrib/pst-poly
\usepackage{pst-optic}
\usepackage{pst-eucl}
\usepackage{pst-math}
\usepackage{pst-func}
\usepackage{pstricks-add}


\setlength{\topmargin}{-2.9cm}% \addtolength{\topmargin}{.4pt}
\addtolength{\oddsidemargin}{-2cm} \textheight26.9cm \textwidth16.5cm


\begin{document}



\begin{center}
\begin{pspicture}(-1,-1)(12,5)
 \psframe*[linecolor=green!20](-0.8,-0.8)(12.5,4.6)
 \psframe*[linecolor=white](0,0)(12,4.0)
 \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0,xunit=1,yunit=1.333](0,0)(11.5,3.0)\psset{xAxisLabel=$t$, yAxisLabel=$U$,arrowscale=2}\begin{psgraph}{->}(0,-0.5)(12,1.0){12cm}{4cm}\makeatletter\psplot[plotpoints=20,linecolor=red,linewidth=2pt]{0}{11.5}  [ /yMax 0.5 def /T0 2 def /T1 T0 def ]% <=== this is new !!!!  { x T1 gt {      T1 yMax \tx at ScreenCoor      2 copy 4 2 roll L neg L      /yMax yMax neg def /T1 T1 T0 add def } if yMax }  \end{psgraph}\end{pspicture}\end{center}\begin{center}\begin{pspicture}(-1,-0.5)(12,4) \psframe*[linecolor=green!20](-0.8,-0.5)(12.5,4.6)% \psframe*[linecolor=white](0,0)(12,4) \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0](0,0)(12,4)\psset{xAxisLabel=$t$, yAxisLabel=$I$,arrowscale=2}\def\R{120}%    Widerstand\def\L{0.16}%   Induktivität\def\t{0.004}%    Zeitkonstante\def\A{1}%     Amplitude\begin{psgraph}{->}(0,0)(0,-.5)(12,1.5){12cm}{4cm}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue
 ,yMaxValue=5,yMinValue=-2]{0}{2}  {\A*(1-2.7182818^(-x*\t*\R/\L))}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{4}{6}  {\A*(1-2.7182818^(-(x-4)*\t*\R/\L))}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{8}{10}  {\A*(1-2.7182818^(-(x-8)*\t*\R/\L))}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{2}{4}  {\A*2.7182818^(-(x-2)*\t*\R/\L)}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{6}{8}  {\A*2.7182818^(-(x-6)*\t*\R/\L)}  \psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{10}{11.5}  {\A*2.7182818^(-(x-10)*\t*\R/\L)}  \end{psgraph}\end{pspicture}\end{center}\begin{center}\begin{pspicture}(-1,-0.5)(12,4) \psframe*[linecolor=green!20](-0.8,-0.5)(12.5,4.6)% \psframe*[linecolor=white](0,0)(12,4) \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0](0
 ,0)(12,4)\psset{xAxisLabel=$t$, yAxisLabel=$I$,arrowscale=2}\def\R{120}%    Widerstand\def\L{0.5}%   Induktivität\def\t{0.004}%    Zeitkonstante\def\A{1}%     Amplitude\begin{psgraph}{->}(0,0)(0,-.5)(12,1.5){12cm}{4cm}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{0}{2}  {\A*(1-2.7182818^(-x*\t*\R/\L))}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{4}{6}  {\A*(1-2.7182818^(-(x-4)*\t*\R/\L))}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{8}{10}  {\A*(1-2.7182818^(-(x-8)*\t*\R/\L))}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{2}{4}  {\A*2.7182818^(-(x-2)*\t*\R/\L)}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{6}{8}  {\A*2.7182818^(-(x-6)*\t*\R/\L)}  \psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=blue,yMaxValue=5,yMinValue=-2]{10}{11.
 5}  {\A*2.7182818^(-(x-10)*\t*\R/\L)}  \end{psgraph}\end{pspicture}\end{center}\begin{center}\begin{pspicture}(-1,-1)(12,6) \psframe*[linecolor=green!20](-0.8,-0.4)(12.5,6.8) \psframe*[linecolor=white](0,0)(12,6) \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0](0,0)(12,6)\psset{xAxisLabel=$t$, yAxisLabel=$U_{\text{ind}}$,arrowscale=2}\def\R{120}%    Widerstand\def\L{0.16}%   Induktivität\def\t{0.004}%  Zeitkonstante\def\A{1}%     Amplitude\def\B{1}%     Amplitude\begin{psgraph}{->}(0,0)(0,-1.5)(12,1.5){12cm}{6cm}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=green,yMaxValue=5,yMinValue=-2]{0}{2}  {\A*(-2.7182818^(-x*\t*\R/\L))}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=green,yMaxValue=5,yMinValue=-2]{4}{6}  {\A*(-2.7182818^(-(x-4)*\t*\R/\L))}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=green,yMaxValue=5,yMinValue=-2]{8}{10}  {\A*(-2.7182818^(-(x-8)*\t*\R/\L))}\psplot[linewidth=1pt,algebraic=true,plotpoints=
 500,linecolor=green,yMaxValue=1.5,yMinValue=-2]{2}{4}  {\B*2.7182818^(-(x-2)*\t*\R/\L)}\psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=green,yMaxValue=1.5,yMinValue=-2]{6}{8}  {\B*2.7182818^(-(x-6)*\t*\R/\L)}  \psplot[linewidth=1pt,algebraic=true,plotpoints=500,linecolor=green,yMaxValue=1.5,yMinValue=-2]{10}{11.5}  {\B*2.7182818^(-(x-10)*\t*\R/\L)}%  \psline[linewidth=1pt,linecolor=blue](2,0)(2,1.5)%%  \psline[linewidth=1pt,linecolor=blue](6,0)(6,1.5)%%  \psline[linewidth=1pt,linecolor=blue](10,0)(10,1.5)%  \end{psgraph}\end{pspicture}\end{center}\end{document}--------------------------------------------------From: "Herbert Voss" <Herbert.Voss at fu-berlin.de>Sent: Thursday, February 24, 2011 6:26 PMTo: "Graphics with PSTricks" <pstricks at tug.org>Cc: <Thomas.Soell at onlinehome.de>Subject: Re: [pstricks] Function of the current in a coil> Am 23.02.2011 22:42, schrieb Thomas Söll 1und1:>>> I want to draw the current through a coil. The example shows my result.It seems 
 to be ok.>> The problem comes, if I want to draw the current for parameters where themaximal current is not reached, as shown in the last example.>> Then the parts of the function are not continual.>>>> The endpoints should be calculated and this gives the startpoint from thenext curve and so on.>>>> Does anybody knows a solution?>>>>\documentclass[a4paper,12pt]{article}\usepackage[T1]{fontenc}\usepackage[latin1]{inputenc}\usepackage{ngerman}> ...>> please provide an example with linebreaks!>> Herbert> _______________________________________________> PSTricks mailing list> PSTricks at tug.org> http://tug.org/mailman/listinfo/pstricks> archive: http://www.tug.org/pipermail/pstricks/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Induktion-1.pdf
Type: application/pdf
Size: 70897 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20110224/50ba71d1/attachment-0002.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Induktion-tex.pdf
Type: application/pdf
Size: 17151 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20110224/50ba71d1/attachment-0003.pdf>


More information about the PSTricks mailing list