Guest User

Untitled

a guest
Feb 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. dg[x1_, x2_] := (2 (x1 + E^(4 (x1 - x2)^2) x1 - 2 x1^3 - 2 x2 + 2 x1^2 x2 + 2 E^(2 (x1 - x2)^2) (x1 - x2) (-1 + x2^2)))/((-1 + E^(4 (x1 - x2)^2)) (-1 + x1^2));
  2. dg2[x1_, x2_] := 2/((-1 + E^(4 (x1 - x2)^2)) (-1 + x1^2)^2) (-1 + 7 x1^2 - 10 x1^4 + 8 x1^6 + E^(4 (x1 - x2)^2) (1 - 7 x1^2 + 2 x1^4) - 8 x1 x2 + 24 x1^3 x2 - 16 x1^5 x2 + 8 x2^2 - 16 x1^2 x2^2 + 8 x1^4 x2^2 - 8 E^(2 (x1 - x2)^2) (x1 - x2) (-1 + x2) (1 + x2) (x1^3 + x2 - x1^2 x2));
  3.  
  4. iso = ContourPlot[dg[x1, x2] == 0, {x1, -1, 1}, {x2, -1, 1},
  5. Exclusions -> {x1 == x2}, PlotPoints -> 50];
  6. cp = ContourPlot[dg2[x1, x2], {x1, -1, 1}, {x2, -1, 1},
  7. PlotPoints -> 50, Contours -> {0}, ContourShading -> {White, LightRed}];
  8. Show[cp, iso]
  9.  
  10. ExtractPlotPoints[plot_Graphics] := Cases[Normal@plot, Line[x_] :> x, [Infinity]];
  11.  
  12. isocol = ListLinePlot[ExtractPlotPoints[iso],
  13. ColorFunction -> (If[dg2[#1, #2] > 0, Red, Black] &),
  14. ColorFunctionScaling -> False, Frame -> True, Axes -> False,
  15. AspectRatio -> 1, PlotRange -> {{-1, 1}, {-1, 1}}];
  16. Show[cp, isocol]
  17.  
  18. ListLinePlot[ExtractPlotPoints[iso],
  19. MeshFunctions -> {dg2[#1, #2] &}, Mesh -> {{0}},
  20. MeshShading -> {Directive[Black, Thick], Directive[Red, Thin]},
  21. MeshStyle -> None, Frame -> True, Axes -> False, AspectRatio -> 1]
  22.  
  23. Limit[dg2[x1, x2], {x2 -> x1}]
  24. (* (-2 + 4 x1^2)/(-1 + x1^2) *)
  25.  
  26. dg2[x1_, x1_] = (-2 + 4 x1^2)/(-1 + x1^2);
  27. isonew = ListLinePlot[ExtractPlotPoints[iso],
  28. MeshFunctions -> {dg2[#1, #2] &}, Mesh -> {{0}},
  29. MeshShading -> {Directive[Black, Thick], Directive[Red, Thin]},
  30. MeshStyle -> None, Frame -> True, Axes -> False, AspectRatio -> 1];
  31. Show[cp, isonew]
Add Comment
Please, Sign In to add comment