
Perdón por mi inglés incorrecto.
He modificado el código deaquípara adaptarlo para el TikZ datavisualization
. Aquí está el código adaptado:
\documentclass{scrartcl}
\usepackage{tikz}
\usepackage[per-mode = fraction]{siunitx}
\usetikzlibrary{datavisualization.formats.functions}
\begin{document}
\begin{tikzpicture}
\datavisualization[
scientific axes = {clean, end labels},
all axes = {ticks and grid = {major at = 0}},
x axis = {label = $\frac{H}{\si{\A\per\m}}$},
y axis = {label = $\frac{B(H)}{\si{\tesla}}$},
data/format = function,
visualize as smooth line/.list = {left, right}
]
data[set = left] {
var x : interval [-7 : 7];
func y = 5 / (1 + exp(-1.7 * \value x - 1.5)) - 2.5;
}
data[set = right] {
var x : interval [-7 : 7];
func y = 5 / (1 + exp(-1.7 * \value x + 1.5)) - 2.5;
}
%accents important points
info {
\draw (visualization cs:x = {(-1.5 / 1.7)}, y = 0) circle [radius = 1pt]
node [left, font = \footnotesize] {$H_C$};
}
info {
\draw (visualization cs:x = 0, y = 1.59) circle [radius = 1pt]
node [left, font=\footnotesize] {$B_R$};
}
info {
\draw (visualization cs:x = 7, y = 2.5) circle [radius = 1pt]
node [above, font=\footnotesize] {$B_S$};
};
\end{tikzpicture}
\end{document}
Pero recibo muchos de estos errores:
! Dimensión demasiado grande.
\pgfmath@iterate
...\pgfmath@xa \ifdim \pgfmath@x
Uno puede usar lo TikZ fpu
mismo que hizo.aquí,aquíyaquí. Aquí está mi código:
\documentclass{scrartcl}
\usepackage{tikz}
\usepackage[per-mode = fraction]{siunitx}
\usetikzlibrary{datavisualization.formats.functions,fpu}
\begin{document}
\begin{tikzpicture}
\datavisualization[
scientific axes = {clean, end labels},
all axes = {ticks and grid = {major at = 0}},
x axis = {label = $\frac{H}{\si{\A\per\m}}$},
y axis = {label = $\frac{B(H)}{\si{\tesla}}$},
data/format = function,
visualize as smooth line/.list = {left, right}
]
data[set = left] {
var x : interval [-7 : 7];
\pgfkey{/pgf/fpu, /pgf/fpu/output format=fixed}
func y = 5 / (1 + exp(-1.7 * \value x - 1.5)) - 2.5;
\pgfkeys{/pgf/fpu=false}
}
data[set = right] {
var x : interval [-7 : 7];
\pgfkey{/pgf/fpu, /pgf/fpu/output format=fixed}
func y = 5 / (1 + exp(-1.7 * \value x + 1.5)) - 2.5;
\pgfkeys{/pgf/fpu=false}
}
%accents important points
info {
\draw (visualization cs:x = {(-1.5 / 1.7)}, y = 0) circle [radius = 1pt]
node [left, font = \footnotesize] {$H_C$};
}
info {
\draw (visualization cs:x = 0, y = 1.59) circle [radius = 1pt]
node [left, font=\footnotesize] {$B_R$};
}
info {
\draw (visualization cs:x = 7, y = 2.5) circle [radius = 1pt]
node [above, font=\footnotesize] {$B_S$};
};
\end{tikzpicture}
\end{document}
Pero luego mi pdfLaTeX
compilador TeXnicCenter
se ejecuta en un bucle sin fin. ¿Qué me equivoco?
Por cierto: las líneas decorativas de arriba ya se ven iguales (solo cambian las coordenadas, la alineación y el texto). ¿Hay alguna manera de combinarlo/optimizarlo?
¡De forma anticipada, muchas gracias por su ayuda!
Respuesta1
Parece que cuando el valor de x se convierte en un número negativo "grande", se descompone. Si cambia el límite inferior de la left
curva a -6,5 y la right
curva a -4,5, se compila bien aquí.
\documentclass{scrartcl}
\usepackage{tikz}
\usepackage[per-mode = fraction]{siunitx}
\usetikzlibrary{datavisualization.formats.functions}
\begin{document}
\begin{tikzpicture}
\datavisualization[
scientific axes = {clean, end labels},
all axes = {ticks and grid = {major at = 0}},
x axis = {label = $\frac{H}{\si{\A\per\m}}$},
y axis = {label = $\frac{B(H)}{\si{\tesla}}$},
data/format = function,
visualize as smooth line/.list = {left, right}
]
data[set = left] {
var x : interval [-6.5 : 7];
func y = 5 / (1 + exp(-1.7 * \value x - 1.5)) - 2.5;
}
data[set = right] {
var x : interval [-4.5 : 7];
func y = 5 / (1 + exp(-1.7 * \value x + 1.5)) - 2.5;
}
%accents important points
info {
\draw (visualization cs:x = {(-1.5 / 1.7)}, y = 0) circle [radius = 1pt]
node [left, font = \footnotesize] {$H_C$};
}
info {
\draw (visualization cs:x = 0, y = 1.59) circle [radius = 1pt]
node [left, font=\footnotesize] {$B_R$};
}
info {
\draw (visualization cs:x = 7, y = 2.5) circle [radius = 1pt]
node [above, font=\footnotesize] {$B_S$};
};
\end{tikzpicture}
\end{document}