# how to plot function from multiple points

Actually wanted to draw and plot Optical and acoustic branch but don't know it what's the command to draw a function like this ? Thanks for the help

• I wouldl guess that the math refers only to the intersections with the axes, (0-\pi/a ?). You really don't have enough information here to do anything. I would overlay some graph paper and start recording points, then graph using smooth. Jun 15, 2019 at 12:53

pgfplots can produce such plots.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[declare function={%
omegaplus(\k,\K,\a,\mone,\mtwo)=sqrt(\K*(1/\mone+1/\mtwo)+
\K*sqrt((1/\mone+1/\mtwo)^2-4*pow(sin(\k*\a/2),2)/(\mone*\mtwo)));
omegaminus(\k,\K,\a,\mone,\mtwo)=sqrt(\K*(1/\mone+1/\mtwo)-
\K*sqrt((1/\mone+1/\mtwo)^2-4*pow(sin(\k*\a/2),2)/(\mone*\mtwo)));}]
\begin{axis}[axis x line=bottom,axis y line=middle,trig format=rad,
xlabel={$k$},xtick=\empty,ytick=\empty,ymax=2,xmax=3.5,clip=false,
node[pos=0,left,black]{$\displaystyle2C\left(\frac{1}{m_1}+\frac{1}{m_2}\right)^{1/2}$}
node[pos=1,right,black]{$\displaystyle\left(\frac{2C}{m_1}\right)^{1/2}$}
node[midway,above,sloped,font=\sffamily]{optical branch};
node[pos=1,right,black]{$\displaystyle\left(\frac{2C}{m_2}\right)^{1/2}$}
node[midway,above,sloped,font=\sffamily]{acoustic branch};
\draw[thick] (pi,0)  -- (pi,2);
\end{axis}
\end{tikzpicture}
\end{document} • Thanks a lot , could you explain what you've done here by declaring the function and how do you put "acoustic branch" and "optical branch" in exact proper position. Jun 16, 2019 at 5:55
• @Quintis (I see this comment only now, sometimes comments get swallowed by the system.) All I did was to punch in the dispersion relations for phonons, which can be found e.g. here. And then you can position stuff with pos=<f> where f=0 is the start and f=1 the end of the plot.
– user121799
Jun 19, 2019 at 21:24