2
$\begingroup$

I'm currently studying atmospheric-gravity waves and their dispersion relations.

I want to have look at values of $(x,y)$ that solve the following system :

\begin{equation}\label{}(1) \left\{ \begin{array}{rcr} (x+\frac{1}{2}y^{2})\exp(u^2)-y[u+\exp(u^2)]+u\exp(u^2)& = &0\\ 2u(x+\frac{1}{2}y^{2})\exp(u^2)-y[1+u\exp(u^2)]+u^2& < &0\\ \end{array} \right. \end{equation}

where $x\in [0,1]$, $y\in[0,1]$ and $u\in[0,1]$.

My goal is to plot the region $(x,y)$ where this system has a solution. How can I plot S in the $(x,y)$-plane.?

The code for the first funtion :

f1[u_, x_, y_] := ((y^2)/2 + x)*Exp[u^2] - y*(u + Exp[u^2]) + u*Exp[u^2]
f2[u_, x_, y_] := 2*u*((y^2)/2 + x)*Exp[u^2] - y*(1 + u*Exp[u^2]) +  u^2

The problem is how to used : ContourPlot or RegionFunction to construct the surface S.

$\endgroup$
1
$\begingroup$
f1[u_, x_, y_] := ((y^2)/2 + x)*Exp[u^2] - y*(u + Exp[u^2]) +  u*Exp[u^2];
f2[u_, x_, y_] := 2*u*((y^2)/2 + x)*Exp[u^2] - y*(1 + u*Exp[u^2]) + u^2; 
cp1 = ContourPlot3D[f1[u, x, y] == 0, {x, 0, 1}, {y, 0, 1}, {u, 0, 1},
       Mesh -> None, 
       ContourStyle -> Directive[Orange, Opacity[0.8], Specularity[White, 30]], 
       ImageSize -> 400]; 
cp2 = ContourPlot3D[f1[u, x, y] == 0, {x, 0, 1}, {y, 0, 1}, {u, 0, 1}, 
       Mesh -> None, 
       ContourStyle -> Directive[Orange, Opacity[0.8], Specularity[White, 30]], 
       ImageSize -> 400, 
       RegionFunction -> Function[{x, y, u}, f2[u, x, y] < 0]];
Row[{cp1, cp2}, Spacer[5]]

enter image description here

$\endgroup$
  • $\begingroup$ This is almost what I want but I asked for the projection of the solution on (x,y) plan, and I used your code to do that : Graphics[Cases[cp2, GraphicsComplex[p___, OptionsPattern[]] :> (GraphicsComplex[p] /. {u_Real, y_Real, x_Real} :> {x, y})], Axes -> True] $\endgroup$ – Lea May 21 '14 at 21:04
  • $\begingroup$ Lea, Thanks for the accept. Sorry I missed the projection part altogether:) $\endgroup$ – kglr May 21 '14 at 22:20
2
$\begingroup$

You did not write what you are looking for as the function of what? If it is not important let us look for x and y as the functions of u. One can first put f2(x,y,u)=0 and get the boundaries of the region, where the solution exists, and then f2(x,y,u)=-eps with 0

    Manipulate[
 sl1 = Solve[{f1[u, x, y] == 0, f2[u, x, y] == 0}, {x, y}][[1]];
 sl2 = Solve[{f1[u, x, y] == 0, f2[u, x, y] == -\[Epsilon]}, {x, 
     y}][[1]];
 ParametricPlot[{{x /. sl1, y /. sl1}, {x /. sl2, y /. sl2}}, {u, 0, 
   1}, PlotStyle -> {Blue, Red}, 
  AxesLabel -> {Style["x", 16, Italic], Style["y", 16, Italic]}, 
  PlotRange -> {{-0.5, 1.5}, {-0.5, 1.5}}], {{\[Epsilon], 0.43}, 0, 
  1}]

You should see the following on the screen: enter image description here The blue lines limit the region where the solution exists, while the red lines give the solutions at any fixed value of eps. In application to your domain it means that the solution exists at the whole domain limited from above by the dashed line (at y=1) except for a small fragment, where the blue line is below the dashed one. Here it is below the blue line.

$\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.