Message Boards Message Boards

How to plot implicit function with intermediate variable

Posted 3 years ago

Here, I intend to plot a 3D picture of enter image description here

with two implicit functions

enter image description here

where x, y, t, \xi, \eta, are variables. Of course, these variables can be constrained to certain interval that will guarantee the function to be well-posed.

How can I draw this one?

Attachments:
POSTED BY: Lingfei Li
8 Replies
Posted 3 years ago

With : t=1;

With[{t = 1}, 
 ListPlot3D[
  Flatten[Table[{x, y, func[\[Xi], \[Eta], t]} /. 
     xyToXiEta[x, y, t], {x, -1, 1, 1/20}, {y, -1, 1, 1/20}], 2], 
  BoxRatios -> {1, 1, 1}, Axes -> True, 
  PlotRange -> {All, All, 2000 {-1, 1}}, AxesLabel -> {x, y, z}]]

enter image description here

POSTED BY: Mariusz Iwaniuk
Posted 3 years ago

Thank you for your reply.

POSTED BY: Lingfei Li

Here is an attempt:

func[\[Xi]_, \[Eta]_, 
   t_] = -((1350.` Sech[\[Eta]]^2 Tanh[\[Eta]] (1.` Sech[
             0.1 t - \[Xi]]^2 Tanh[0.1 t - \[Xi]] + 
           0.6` Sech[0.3 t - \[Xi]]^2 Tanh[0.3 t - \[Xi]] + 
           1.6` Sech[0.1 t + \[Xi]]^2 Tanh[0.1 t + \[Xi]]))/((1 - 
           1.5 Sech[\[Eta]]^2) (1 - Sech[0.1 t - \[Xi]]^2 - 
           0.5 Sech[0.3 t - \[Xi]]^2 - 
           1.5 Sech[0.1 t + \[Xi]]^2) (0.3 Sech[\[Eta]]^2 + 
           0.5 Sech[0.1 t - \[Xi]]^2 + 0.3 Sech[0.3 t - \[Xi]]^2 - 
           0.8` Sech[0.1 t + \[Xi]]^2)^2)) // Rationalize // 
   Simplify;
xyToXiEta[x_?NumericQ, y_, t_] := 
  NSolve[{x == \[Xi] - 1/2 Tanh[\[Xi] - 3/10 t] - 
      Tanh[\[Xi] - 1/10 t] - 3/2 Tanh[\[Xi] + 1/10 t], 
    y == \[Eta] - 3/2 Tanh[\[Eta]]}, {\[Xi], \[Eta]}, Reals];
With[{t = 1},
 ListPointPlot3D[
  Flatten[
   Table[{x, y, func[\[Xi], \[Eta], t]} /. xyToXiEta[x, y, t], {x, -1,
      1, 1/20}, {y, -1, 1, 1/20}], 2], BoxRatios -> {1, 1, 1}, 
  Axes -> True, PlotRange -> {All, All, 2000 {-1, 1}}, 
  AxesLabel -> {x, y, z}]]
POSTED BY: Gianluca Gorni
Posted 3 years ago

Thank you for your reply, it gives me a clue.

POSTED BY: Lingfei Li
Posted 3 years ago

Unfortunately,

NSolve[{x == \[Xi] - 1/2 Tanh[\[Xi] - 3/10 t] - Tanh[\[Xi] - 1/10 t] - 3/2 Tanh[\[Xi] + 1/10 t], y == \[Eta] - 3/2 Tanh[\[Eta]]}, {\[Xi], \[Eta]}, Reals]

does not function.

POSTED BY: Lingfei Li
Posted 3 years ago

Sorry for the mistake, it does function.

POSTED BY: Lingfei Li

When t=0 the function you want to plot is identically zero.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract