Seite 1 von 2

Exponentialfunktionen bewegen

Verfasst: Di 10. Dez 2019, 12:38
von Eduard
\documentclass[12pt,oneside]{report}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{amsmath}
\usetikzlibrary{arrows}


\begin{document}

\begin{figure}[h!]
\centering

\begin{tikzpicture}[domain=0:6,range=4:5, scale=1,thick ]
\usetikzlibrary{calc}
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x,\textcolor{cyan}{x_2}}$};
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{\textcolor{green}{y}}$};

\draw (4,0) arc (0:90:4);
\draw[thick,color=purple,domain=2.5:7.5] plot (\x,{25*exp(-.7*\x-.25)+.7}) node[right] {$\bar{u}_2$};
\end{tikzpicture}

\begin{tikzpicture}[domain=0:6,range=4:5, scale=1,thick ]
\usetikzlibrary{calc}
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{x_1}$};
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{p}$};

\end{tikzpicture}

\begin{tikzpicture}[domain=0:6,range=4:5, scale=1,thick ]
\usetikzlibrary{calc}
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x_2}$};
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{y}$};


\end{tikzpicture}
\caption{Samuelson-Regel}
\end{figure}

\end{document}

Hallo zusammen,

ich versuche dieses Model (siehe Anhang) in Latex umzusetzen. Kenne mic aber mit tikzpicture noch nicht so gut aus und weiß nicht, wie ich die Exponentialfunktion bewegen kann, also wie ich y-Werte/-Variablen eingeben kann und wie ich es hinbekommen, dass sich die drei Elemente nicht verschieben, so dass die durchgestrichelten Linien auch an der richtigen Stelle sind. Über Hilfe wäre ich sehr dankbar!

Verfasst: Di 10. Dez 2019, 12:49
von Gast
Tippfehler erzeugt Fehlermeldung: \begin{docuement}

Verfasst: Di 10. Dez 2019, 12:50
von Eduard
Sorry! Danke für den Hinweis! Habs geändert!

Zusammenpacken

Verfasst: Di 10. Dez 2019, 14:16
von Ratgeber
Pack alles zusammen in eine einzige Umgebung `tikzpicture`.

Verfasst: Di 10. Dez 2019, 14:17
von Eduard
Ok! Und Wie bekomme ich das mit der Exponentialfunktion hin?

Bewegung

Verfasst: Di 10. Dez 2019, 15:15
von Ratgeber
Wenn es darum geht, die Funktion im Bild zu verschieben, dann schau dir die Optionen `xshift`, `yshift` oder `shift` in der Anleitung zu »PGF/TikZ« (durch Suche im Index) an.

Re: Zusammenpacken

Verfasst: Di 10. Dez 2019, 16:15
von Eduard
Ratgeber hat geschrieben:Pack alles zusammen in eine einzige Umgebung `tikzpicture`.
Hab das versucht, aber ich bekomme es nicht hin. Dachte ich weiß, was du meinst.

Verfasst: Di 10. Dez 2019, 16:27
von Bartman
Eduards Anhang:

Bild

Das verstehe ich unter "zusammenpacken":
\documentclass[12pt]{report}
\usepackage{tikz}% lädt graphicx
\usepackage{amsmath}
\usepackage{showframe}

\usetikzlibrary{intersections}

\begin{document}
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[domain=0:6, range=4:5, thick]
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x,\textcolor{cyan}{x_2}}$};
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{\textcolor{green}{y}}$};

\draw [name path=f1a] (4,0) arc [start angle=0, end angle=90, x radius=4, y radius=3];
\draw [name path=f1b, thick, color=purple, domain=2.5:7.5, shift={(-2,.2)}] 
    plot (\x,{25*exp(-.7*\x-.25)+.7}) node[right] {$\bar{u}_2$};

\begin{scope}[yshift=-6cm]
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{x_1}$};
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{p}$};

\draw [name path global=f2a] (4,0) arc [start angle=0, end angle=90, x radius=4, y radius=3];
\draw [name path global=f2b, thick, color=purple, domain=2.5:7.5, shift={(-2,.2)}] 
    plot (\x,{25*exp(-.7*\x-.25)+.7});
\end{scope}

\begin{scope}[yshift=-12cm]
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x_2}$};
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{y}$};
\end{scope}

\path [name intersections={of=f1a and f1b, by=is f1 left}];
\path [name intersections={of=f2a and f2b, by=is f2 left}];
\draw [dotted] (is f1 left) -- (is f2 left);
\end{tikzpicture}
\caption{Samuelson-Regel}
\end{figure}
\end{document}

Verfasst: Di 10. Dez 2019, 16:52
von Eduard
\documentclass[12pt]{report}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{showframe}

\usetikzlibrary{intersections}

\begin{document}
\begin{figure}[h!] 
\centering 
\begin{tikzpicture}[domain=0:6,range=4:5, thick] 
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x,\textcolor{cyan}{x_2}}$}; 
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{\textcolor{green}{y}}$}; 

\draw [name path=f1a] (4,0) arc [start angle=0, end angle=90, x radius=4, y radius=3]; 
\draw[name path=f1b, thick, color=purple, domain=2.5:7.5, shift={(-2,.2)}] 
    plot (\x,{25*exp(-.7*\x-.25)+.7}) node[right] {$\bar{u}_2$}; 

\begin{scope}[yshift=-6cm] 
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{y}$}; 
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x_1}$}; 

\draw [name path global=f2a] (4,0) arc [start angle=0, end angle=180, x radius=1.5, y radius=1]; 
\end{scope} 

\begin{scope}[yshift=-12cm] 
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x_2}$}; 
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{y}$};
\draw[name path global=f2b, thick, color=purple, domain=3:5.5, shift={(-.5,-.4)}] 
    plot (\x,{25*exp(-.7*\x-.25)+.7}); 
\draw[name path global=f2b, thick, color=purple, domain=3:5.5, shift={(-1.5,-.4)}] 
    plot (\x,{25*exp(-.7*\x-.25)+.7});  
\draw[name path global=f2b, thick, color=purple, domain=3:5.5, shift={(.5,-.4)}] 
    plot (\x,{25*exp(-.7*\x-.25)+.7});  
\end{scope} 

\path [name intersections={of=f1a and f1b, by=is f1 left}]; 
\path [name intersections={of=f2a and f2b, by=is f2 left}]; 
\draw [dotted] (is f1 left) -- (is f2 left); 
\end{tikzpicture} 
\caption{Samuelson-Regel} 
\end{figure}

\end{document}
Habe versucht das Ganze an meine Vorlage anzupassen, aber war leider nicht sehr erfolgreich. Ich weiß nicht was besser ist: die parallele Verschiebung der Funktion ganz unter: ist die e-Funktion da geeignet oder macht man sowas lieber mit der Kreis-Funktion? Wie kann ich die Verbindungslinien genau ziehen, so dass sie durch alle drei Figuren durchgehen?

Verfasst: Di 10. Dez 2019, 18:13
von Bartman
Eduard hat geschrieben:Wie kann ich die Verbindungslinien genau ziehen, so dass sie durch alle drei Figuren durchgehen?
Dafür änderst Du "einfach" die Bezugspunkte.

Ein weiteres Beispiel:
\documentclass[12pt]{report}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{showframe}

\usetikzlibrary{intersections}

\begin{document}
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[domain=0:6, range=4:5, thick]
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x,\textcolor{cyan}{x_2}}$};
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{\textcolor{green}{y}}$};

\draw [name path=f1a] (4,0) 
    arc [start angle=0, end angle=90, x radius=4, y radius=3]
;
\draw[name path=f1b, thick, color=purple, domain=2.5:7.5, shift={(-2,.2)}]
    plot (\x,{25*exp(-.7*\x-.25)+.7}) node[right] {$\bar{u}_2$}
;

\begin{scope}[yshift=-6cm]
\draw [->] (0,0) -- (4.5,0) node[right] {$\pmb{y}$};
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x_1}$};

\draw [name path global=f2a] (4,0) arc [start angle=0, end angle=180, x radius=1.5, y radius=1];
\end{scope}

\begin{scope}[yshift=-12cm]
\draw [->] (0,0) -- (0,4.5) node[above] {$\pmb{x_2}$};
\draw [->, name path global=f3xline] (0,0) -- (4.5,0) node[right] {$\pmb{y}$};
\draw[name path global=f3a, thick, color=purple, domain=3:5.5, shift={(-.5,-.4)}]
    plot (\x,{25*exp(-.7*\x-.25)+.7});
\draw[name path global=f3b, thick, color=purple, domain=3:5.5, shift={(-1.5,-.4)}]
    plot (\x,{25*exp(-.7*\x-.25)+.7});  
\draw[name path global=f3c, thick, color=purple, domain=3:5.5, shift={(.5,-.4)}]
    plot (\x,{25*exp(-.7*\x-.25)+.7});  
\end{scope}

\path [name path=vline] 
    ([xshift=4mm]current bounding box.north) -- 
    ([xshift=4mm]current bounding box.south)
;
\path [name intersections={of=f1a and vline, by=is f1a vline}];
\path [name intersections={of=f3xline and vline, by=is f3xline vline}];
\draw [dotted] (is f1a vline) -- (is f3xline vline) node [below] {$y^*$};
\end{tikzpicture}
\caption{Samuelson-Regel}
\end{figure}
\end{document}