The intention is to plot the following equation: P*sin(x)/x + cos(x), for P = 1.6 and x in [0, 5], which, ignoring the green-filled areas, should look someting like:
However, from the following code:
x = 0 : 0.01 : 5; % ka/pi, where k-wavevector, a-lattice spacing.
P = 1.6; % 2*m*U_0 / hbar^2.
rhs = P * sinc(x*pi) + cos(x*pi);
rhs2 = P * ( sin(x*pi) / x*pi) + cos(x*pi);
plot(x, rhs, '--b', x, rhs2, 'b', x, -1*ones(size(x)), 'r', x, 1*ones(size(x)), 'r')
axis([0 5 -3 3])
xlabel('ka/pi')
legend('P*sinc(x) + cos(x)', '(2mU_0b)/(hbar^2) * sin(ka)/ka + cos(ka)', 'y = -1', 'y = 1')
what I currently get is:
What am I doing wrong here?
I am on Windows 10, Octave-4.2.1



