Tuesday, September 17, 2019

MathJax example 2

Testing MathJax Example 2 (autonumbering) This is the test of equation \ref{num1} (but ( eqref(num1) )\eqref{num1} also works) \begin{equation} \sqrt{b^2} = \pm b \label{num1} \end{equation} In equation \eqref{eq:sample}, we find the value of an interesting integral: \begin{equation} \int_0^\infty \frac{x^3}{e^x-1}\,dx = \frac{\pi^4}{15} \label{eq:sample} \end{equation}

<head> 
  <title>Testing MathJax Example 2 (autonumbering)</title>
  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
  <script>
  MathJax = {
    tex: {
      tags: 'ams'  // should be 'ams', 'none', or 'all'
    }
  };
  </script>
  <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
</head>

<body>
This is the test of equation \ref{num1} (but  ( eqref(num1) )\eqref{num1} also works)
\begin{equation}
  \sqrt{b^2} = \pm b 
  \label{num1}
\end{equation}

In equation \eqref{eq:sample}, we find the value of an
interesting integral:

\begin{equation}
  \int_0^\infty \frac{x^3}{e^x-1}\,dx = \frac{\pi^4}{15} 
  \label{eq:sample}
\end{equation}


<hr>

Monday, September 16, 2019

MathJax Example using Latex and Automatic Equation Numbering

The Harmonic Oscillator The Hamiltonian for the Harmonic Oscillator is \begin{equation}\frac{p^2}{2\mu} + \frac{k}{2} x^2 \end{equation} where p is the momentum operator and x is the postition operator. We know that the Schrödinger prescription is \begin{equation}p \rightarrow - \boldsymbol{i} \hbar \frac{\partial}{\partial x} \end{equation} while $x \rightarrow x$, as usual. This means, as we well know, that the commutator of $x$ and $p$ is non-zero. (Note that we've dropped the operator subscript.)

The commutator: $[\alpha,\beta]$

\begin{equation*} [p,x]f =( px - xp)f = -\boldsymbol{i} \hbar \frac{\partial}{\partial x}xf - x(-\boldsymbol{i} \hbar \frac{\partial}{\partial x}f) \end{equation*} where $f(x) \mapsto f$, which leads to \begin{equation*} [p,x]f =( px - xp)f = -f\boldsymbol{i} \hbar \frac{\partial x}{\partial x} + x \left (-\boldsymbol{i} \hbar \frac{\partial}{\partial x}\right )f - x\left (-\boldsymbol{i} \hbar \frac{\partial}{\partial x}f\right ) \end{equation*} which means, of course, \begin{equation} [p,x] = px - xp = -\boldsymbol{i} \hbar \end{equation}

The Ladder Operators Construction

For the Harmonic Oscillator, we form the two operators \begin{equation} a^+ = p + \boldsymbol{i} \mu\omega x \end{equation} and \begin{equation} a^- = p - \boldsymbol{i} \mu\omega x \end{equation} which differ solely by that intervening sign (Remember that $\omega = \sqrt{\frac{k}{\mu}}$). The entire derivation now hinges on the properties of these two operators. We start with the elementary question, what is the commutator of $a^+$ and $a^-$?
<html>
<head>
<title>The Harmonic Oscillator</title>
  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
  <script>
  MathJax = {
    tex: {
      tags: 'ams'  // should be 'ams', 'none', or 'all'
    }
  };
  </script>
  <script async="" id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<script>
MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']],
tags:'ams'
  },
  svg: {
    fontCache: 'global'
  }
};
</script>




</head>

<body>
The Hamiltonian for the Harmonic Oscillator is
\begin{equation}\frac{p^2}{2\mu} + \frac{k}{2} x^2
\end{equation}

where p is the momentum operator and x is the postition operator. We know that the Schrödinger prescription is
\begin{equation}p \rightarrow - \boldsymbol{i} \hbar \frac{\partial}{\partial x}
\end{equation}

while $x \rightarrow x$, as usual. This means, as we well know, that the commutator of $x$ and $p$ is non-zero. 
(Note that we've dropped the operator subscript.)


<h2>
The commutator: $[\alpha,\beta]$</h2>
\begin{equation*}
[p,x]f =( px - xp)f = -\boldsymbol{i} \hbar \frac{\partial}{\partial x}xf -
x(-\boldsymbol{i} \hbar \frac{\partial}{\partial x}f)
\end{equation*}
where $f(x) \mapsto f$,
which leads to
\begin{equation*}
[p,x]f =( px - xp)f = -f\boldsymbol{i} \hbar \frac{\partial x}{\partial x} +
x \left (-\boldsymbol{i} \hbar \frac{\partial}{\partial x}\right )f - 
x\left (-\boldsymbol{i} \hbar \frac{\partial}{\partial x}f\right )
\end{equation*}
which means, of course,
\begin{equation}
[p,x] = px - xp = -\boldsymbol{i} \hbar
\end{equation}
<br />
<h2>
The Ladder Operators Construction</h2>
For the Harmonic Oscillator, we form the two operators
\begin{equation}
a^+ = p + \boldsymbol{i}  \mu\omega x
\end{equation}
and
\begin{equation}
a^- = p - \boldsymbol{i}  \mu\omega x
\end{equation}
which differ solely by that intervening sign
(Remember that $\omega = \sqrt{\frac{k}{\mu}}$).
The entire derivation now hinges on the properties of these two operators.
We start with the elementary question, what is the commutator of $a^+$ and
$a^-$?


</body>
</html>

Wednesday, September 11, 2019

MathJax example with Latex

MathJax TeX Test Page This is the text \begin{equation} \sqrt{b^2} \end{equation}
<html>
<head>
<title>MathJax TeX Test Page</title>

<script>
MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']]
  },
  svg: {
    fontCache: 'global'
  }
};
</script>
<script type="text/javascript" id="MathJax-script" async
  src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>


</head>
<body>
This is the text
\begin{equation}
\sqrt{b^2}
\end{equation}
</body>




</html>

Wednesday, February 20, 2019

Van der Waals coexistence locus

The coexistence locus for liquid vapor equilibrium of a van der Waals fluid can be obtained exactly. The wxMaxima code for obtaining it is shown below the figure.
The traditional vapor-liquid coexistence locus for the van der Waals fluid.


reset;
vg(x) := -1/6*(4*x*exp(2*x) - exp(4*x) + 1)*exp(x)/(x*exp(3*x) + x*exp(x)
    - exp(3*x) + exp(x)) + 1/3 $
vl(x)  := -1/6*(4*x*exp(2*x) - exp(4*x) + 1)*exp(-x)/(x*exp(3*x) + x*exp(x)
    - exp(3*x) + exp(x)) + 1/3$

T(d) :=
            -27/4*((4*d*exp(2*d) - exp(4*d) + 1)*((4*d*exp(2*d) - exp(4*d) + 1)*
                    exp(-d)/(d*exp(3*d) + d*exp(d) - exp(3*d) + exp(d)) - 2)^2*exp(d)
                /(d*exp(3*d) + d*exp(d) - exp(3*d) + exp(d)) + (((4*d*exp(2*d) - exp(4*d) + 1)
                        *exp(d)/(d*exp(3*d) + d*exp(d) - exp(3*d) + exp(d)) - 2)^2 +
                    4*(4*d*exp(2*d) - exp(4*d) + 1)*exp(d)/(d*exp(3*d)
                        + d*exp(d) - exp(3*d) + exp(d)) - 4)*((4*d*exp(2*d) - exp(4*d) + 1)
                    *exp(-d)/(d*exp(3*d) + d*exp(d) - exp(3*d) + exp(d)) - 2) +
                2*((4*d*exp(2*d) - exp(4*d) + 1)*exp(d)/(d*exp(3*d) + d*exp(d) - exp(3*d)
                        + exp(d)) - 2)^2 + 4*(4*d*exp(2*d) - exp(4*d) + 1)*exp(d)/(d*exp(3*d)
                    + d*exp(d) - exp(3*d) + exp(d)) - 8)/(((4*d*exp(2*d) - exp(4*d) + 1)
                    *exp(-d)/(d*exp(3*d) + d*exp(d) - exp(3*d) + exp(d)) - 2)^2*((4*d*exp(2*d)
                        - exp(4*d) + 1)*exp(d)/(d*exp(3*d) + d*exp(d)
                        - exp(3*d) + exp(d)) - 2)^2)$
pg(d) := 8*T(d)/(3*vg(d)-1)-3/vg(d)^2$       
pl(d) := 8*T(d)/(3*vl(d)-1)-3/vl(d)^2$

wxplot2d([vg(x),vl(x)],[x,0.1,1]);
wxplot2d(T(x),[x,0.1,1]);
wxplot2d(pg(x),[x,0.1,1]);
s1:parametric(vg(d),pg(d),d,0.01,0.9)$
s2:parametric(vl(d),pl(d),d,0.01,0.9)$
wxdraw2d(nticks=21,line_width=2,color=red,key="gas",s1,line_width=2,color=blue,key="liquid",s2,
xlabel="p_r",ylabel="v_r",terminal   = 'png,file_name = "vdw8_out");
    /*wxdraw3 draws here; else draw3 draws in rotatable gnuplot window and
       draw_file(terminal =  'png, file_name = "~/Desktop/vdw8_out");*/

To put the first plot (above) in context, below is the pseudo-3D plot of the same coexistence locus, this time showing the explicit temperature (reduced) dependence. The above plot can be thought of as placing one's eyes along the reduced temperatue axis at a high value of T, and looking backwards at the p-V projection.

The pseudo three dimensional representation of the vapor-liquid coexistence locus for the van der Waals fluid.