File:Induction.gif

From Wikiversity
Jump to navigation Jump to search

Original file(770 × 682 pixels, file size: 446 KB, MIME type: image/gif, looped, 25 frames, 5.0 s)

This is a file from the Wikimedia Commons. The description on its description page there is shown below.

Commons is a freely licensed media file repository. You can help.

Summary

Description
English: Animation explaining induction.
Deutsch: Animation Induktion
Date
Source Own work
Author And1mu

Source Code

created with LaTeX and PGF/TikZ

Script to create the animation:

#!/bin/bash
set -eu
DIR="animate"
FILE="Induction"
NUM=0
rm ${DIR}/frame???.png
for XPOS in -0.5 -0.25 0 0.25 0.5 0.75 1 1.25 1.5 1.75 2 2.25 2.5 2.75 3 3.25 3.5 3.75 4 4.25 4.5 4.75 5 5.25 5.5  ; do
    sed -i "s/\\\def\\\posx{.\+}/\\\def\\\posx{$XPOS}/" $FILE.tex
    echo "Creating frame $NUM for $XPOS ..."
    pdflatex -shell-escape $FILE.tex 1> /dev/null
    echo "Convert to png ..."
    NUMSTR=$(printf "%03d" $NUM)
    convert -density 200 ${FILE}01.svg -shave 3 ${DIR}/frame${NUMSTR}.png
    NUM=$(($NUM+1))
done
cd $DIR
convert -delay 20 -loop 10000 frame*.png  ${FILE}.gif
cd -

The code to create a single frame:

\documentclass[crop,border=5,tikz,convert={outext=,
  command=\unexpanded{pdf2svg \infile\space\outfile\%02d.svg
    all}},multi=false]{standalone}
\usetikzlibrary{math,calc,through,shapes,patterns,decorations.pathmorphing}

\def\posx{-0.5}

\begin{document}
\begin{tikzpicture}[>=latex]
  \fill[white] (-3,3.5) rectangle (6.5,-4.8);
  \node[black!50!blue] at (1.5,3.3) {$\vec{B}$};
  \fill[black!50!blue!50] (0,0) rectangle (3,3);
  \begin{scope}[shift={(0.5,0.5)}]
    \foreach \x in {0,1,2}{
      \foreach \y in {0,1,2}{
        \draw[thick,black!50!blue] (\x,\y) circle (3mm);
        \draw[thick,black!50!blue]
        (\x-0.21213,\y-0.21213)--(\x+0.21213,\y+0.21213);
        \draw[thick,black!50!blue]
        (\x+0.21213,\y-0.21213)--(\x-0.21213,\y+0.21213);
      }
    }
  \end{scope}
  \begin{scope}[shift={(\posx,0)}]
    \fill[red,opacity=0.75] (-2,0.5) rectangle
    (0,2.5);
    \fill[white] (-3-\posx,0.5) rectangle (0-\posx,2.5);
    \fill[white] (3-\posx,0.5) rectangle (6-\posx,2.5);
    \draw[ultra thick] (-2,0.5) rectangle (0,2.5);
    \draw[ultra thick,black!50!green,fill=black!50!green!20] (-2,1.5) circle (3mm) node[black!50!green]{$V$};
    \draw[dashed] (0,1.5) --+ (0,-6);
    \draw[thick,->] (-1.3,1.5) --+ (0.7,0)
    node[midway,above]{$\vec{v}$};
  \end{scope}
  \begin{scope}[shift={(0,-1.8)}]
    \draw[ultra thick,red]
    (-0.5,0)--(0,0)--(2,1)--(3,1)--(5,0)--(5.5,0);
    \draw[->] (0,-0.1) -- (0,1.25) node[anchor=north east]{$A$};
    \draw[->] (-0.5,0) -- (6,0) node[anchor=west]{$x$};
  \end{scope}
  \begin{scope}[shift={(0,-3.4)}]
    \draw[ultra thick,black!50!green]
    (-0.5,0)--(0,0)|-(2,-1)|-(3,0)|-(5,1)|-(5.5,0);
    \draw[->] (0,-1.25) -- (0,1.25) node[anchor=north east]{$U_\mathrm{ind}$};
    \draw[->] (-0.5,0) -- (6,0) node[anchor=west]{$x$};
  \end{scope}
\end{tikzpicture}

\end{document}

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

19 March 2017

image/gif

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current12:21, 19 March 2017Thumbnail for version as of 12:21, 19 March 2017770 × 682 (446 KB)And1muUser created page with UploadWizard

Global file usage

The following other wikis use this file: