How to extract data from implicit function with a parameter in MAPLE

686 Views Asked by At

I plotted number of functions $y=y(x)$ with different parameter $a$ for given value of $\tau$ (see the code below) via MAPLE

restart;
R0:=gamma+2*ln(2)+Re(Psi(1/2+(1+I)*tanh((1+I)*x)/((tau+0.25e-1*a)*y)))+ln(y);
tau := 9.975;
with(plots);
implicitplot({seq(R0, a = 1 .. 50)}, x = 0 .. 5, y = 0 .. 1, numpoints = 1000);

My question is how I can extract the values of $y$ from these plots in the form of matrix $50\times1000$ ($a\times x$) in data file?

Thanks in a advance.

1

There are 1 best solutions below

0
On

You can use getdata to extract points data from a plot (see documentation https://www.maplesoft.com/support/help/Maple/view.aspx?path=plottools/getdata):

> with(plottools):
> p:=implicitplot({seq(R0, a = 1 .. 50)}, x = 0 .. 5, y = 0 .. 1, numpoints = 1000);
> data:=getdata(p);

By inspecting the structure, you see it gives usually list of curves, their ranges and corresponding points stored in a matrix. For example:

> data[1];
  ["curve", [0. .. 1.21568604536228397, .250000000000000000 .. 1.], 
  Matrix(6, 2, [[1.21568604536228, .250000000000000], 
  [1.18320567278278, .263358865443444], 
  [1.02207824594441, .500000000000000], 
  [.813115565428804, .587376886914239], 
  [.606754726975888, .750000000000000], 
  [0., 1.]])]

You can then iterate through these and do what you want with them (e.g. store them to a file).