# Question:how to extract plot data with plottools:-getdata

## Question:how to extract plot data with plottools:-getdata

Maple

I have simulated 50 trajectories of an ODE system, with  a command roughly like this:

myPlot :=
seq( plots:-odeplot
( Sol(i)
, [ u(t), r(t), q(t) ]
, t = T .. 0                          ### Time Run Backwards
, 'numpoints' = 2*abs(T)
)
, i = 1..50
) :

The plot looks like this (EDIT: apologies, display seems to be broken, but clicking on the link should work): Now, I try to use plottools:-getdata to extract the data points into a text file, as follows:

myData := plottools:-getdata(myPlot)[-1]:
fprintf("C:\\maple\\data\\mydata.txt","%f",myData):
fclose("C:\\maple\\data\\mydata.txt");

["curve",[Float(undefined)..Float(undefined),Float(undefined)..Float(undefined),Float(undefined)..Float(undefined)],[[[` 2000 x 3 `Matrix],[`Data Type: `float],[`Storage: `rectangular],[`Order: `C_order]]]];

But the data looks like this:

1.#QNAN0 1.#QNAN0 1.#QNAN0

--- HERE, many, many lines like above and below ---
---  DELETED FOR CLARITY ---

-0.028303 0.065794 0.073084
-0.026612 0.065919 0.073220
-0.024865 0.066037 0.073359
-0.023053 0.066147 0.073500
-0.021173 0.066248 0.073643
-0.019216 0.066341 0.073787
-0.017177 0.066425 0.073934
-0.015049 0.066500 0.074082
-0.012825 0.066564 0.074232
-0.010496 0.066618 0.074383
-0.008055 0.066661 0.074536
-0.005494 0.066692 0.074689
-0.002804 0.066712 0.074842
-0.000001 0.066718 0.066718

1. It looks like only one trajectory has been exported.
2. Plus the relevant range as seen on the plot above is the bottom 7 or 8 lines only. (corresponding to the first variable, u(t), being roughly between 0 and -0.1.

Am I misunderstanding how to use getdata? Any suggestion?

Extra question: is there a way to instruct getdata to export only the range of values such that, e.g.

-0.1 < u(t) < 0

Note: I'm not posting the worksheet, because it's a big mess, but if requested I could do. ﻿