Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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));
- 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));
- iso = ContourPlot[dg[x1, x2] == 0, {x1, -1, 1}, {x2, -1, 1},
- Exclusions -> {x1 == x2}, PlotPoints -> 50];
- cp = ContourPlot[dg2[x1, x2], {x1, -1, 1}, {x2, -1, 1},
- PlotPoints -> 50, Contours -> {0}, ContourShading -> {White, LightRed}];
- Show[cp, iso]
- ExtractPlotPoints[plot_Graphics] := Cases[Normal@plot, Line[x_] :> x, [Infinity]];
- isocol = ListLinePlot[ExtractPlotPoints[iso],
- ColorFunction -> (If[dg2[#1, #2] > 0, Red, Black] &),
- ColorFunctionScaling -> False, Frame -> True, Axes -> False,
- AspectRatio -> 1, PlotRange -> {{-1, 1}, {-1, 1}}];
- Show[cp, isocol]
- ListLinePlot[ExtractPlotPoints[iso],
- MeshFunctions -> {dg2[#1, #2] &}, Mesh -> {{0}},
- MeshShading -> {Directive[Black, Thick], Directive[Red, Thin]},
- MeshStyle -> None, Frame -> True, Axes -> False, AspectRatio -> 1]
- Limit[dg2[x1, x2], {x2 -> x1}]
- (* (-2 + 4 x1^2)/(-1 + x1^2) *)
- dg2[x1_, x1_] = (-2 + 4 x1^2)/(-1 + x1^2);
- isonew = ListLinePlot[ExtractPlotPoints[iso],
- MeshFunctions -> {dg2[#1, #2] &}, Mesh -> {{0}},
- MeshShading -> {Directive[Black, Thick], Directive[Red, Thin]},
- MeshStyle -> None, Frame -> True, Axes -> False, AspectRatio -> 1];
- Show[cp, isonew]
Add Comment
Please, Sign In to add comment