0
$\begingroup$

I have given the following function:

B[x_] := Sqrt[x^2 - (9 - 3 x)^2]

where x is also dependent of several cos-function. All in all I wanna plot the following function:

ContourPlot[
 B[1/2 (Cos[Subscript[k, x]] + 
     2*Cos[Subscript[k, x]/2]*Cos[Sqrt[3] Subscript[k, z]/2] + 
     6)], {Subscript[k, x], -6 Pi/3, 6 Pi/3}, {Subscript[k, 
  z], -6 Pi/3, 6 Pi/3}, PlotRange -> Full, ImageSize -> 500, 
 FrameTicks -> {Pi/3 Range[-6, 6], Pi/3 Range[-6, 6]}, 
 FrameLabel -> {"k_x", "k_z"}, PlotLegends -> Automatic]

The plot is looking like this: Contour Plot But now I wanna plot sections (or cuts) through the plane. I tried to calculate this:

Solve[B[1/
 2 (Cos[Subscript[k, x]] + 
  2*Cos[Subscript[k, x]/2]*Cos[Sqrt[3] Subscript[k, z]/2] + 6)] == Pi/2, {Subscript[k, x], Subscript[k, z]}]

But all I got was this solution:

Plot[-((2 ArcCos[
1/8 (7 Cos[Subscript[k, x]/2] - 8 Cos[Subscript[k, x]/2]^3 - Sqrt[
   81 Cos[Subscript[k, x]/2]^2 - 
    2 \[Pi]^2 Cos[Subscript[k, x]/2]^2]) Sec[Subscript[k, x]/
  2]^2])/Sqrt[3]), {Subscript[k, x], -10, 10}]

with a plot that doesn't look right at all:

Plot2

In the end I expect something that is comparable to this:

Comparison

How can I plot sections through plane (cuts through levels), so that I get curves in 2D-space?

$\endgroup$
  • $\begingroup$ What is B2 supposed to be? $\endgroup$ – J. M. will be back soon Mar 27 '18 at 11:17
  • $\begingroup$ Sorry all ´B2´ is ´B´. I correct that. $\endgroup$ – Leviathan Mar 27 '18 at 11:18
  • $\begingroup$ You can still use ContourPlot[] for plotting isolated slices: ContourPlot[B[(Cos[kx] + 2 Cos[kx/2] Cos[Sqrt[3] kz/2] + 6)/2] == π/2, {kx, -6 π/3, 6 π/3}, {kz, -6 π/3, 6 π/3}]. $\endgroup$ – J. M. will be back soon Mar 27 '18 at 11:21
  • $\begingroup$ Ah so simple, so true. :D $\endgroup$ – Leviathan Mar 27 '18 at 11:22
0
$\begingroup$

All credit goes to @J.M. who needs help.

ContourPlot[
 B[(Cos[kx] + 2 Cos[kx/2] Cos[Sqrt[3] kz/2] + 6)/2] == π/2
 , {kx, -6 π/3, 6 π/3}
 , {kz, -6 π/3, 6 π/3}
 ]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.