# solving inside for loop and sorting x which are less than 3 and greater than -3 from the list

I give a simple function code here...

Clear[a, x, t];
s = ParametricNDSolve[{x'[t] + a*x[t] == 0, x==1}, x, {t, 0, 100}, {a}]
y = x /. s
y /. s


I tabulated the solution in a list..

r = Table[y[a] /. s, {a, 0, 15}]


Then I used Select to select

st = Select[r, -3 < # < 1 &]


Now i tried to print required $$x$$ with their corresponding $$a$$, but I could not do this.

How could I do this, And their may be a case in which their are repeated x value for common a, how to identify that.Print[s, " ", a]

For reference I attach the pic of my code and result... • Why not tell Solve[] at the outset your constraints on the solution? Table[x /. Solve[x^2 - a^2 == 0 && -3 < x < 3, x], {a, 1, 14}] – J. M.'s technical difficulties Mar 3 '19 at 10:05
• Thanks, it works, but it does not work with ParametricNDSolve or other functions. Actually I wnt to do this logic for a and q parameters of Mathieu equation, without using inbuilt Mathieu functions. – Kamal Kumar Mar 3 '19 at 13:18
• Then you oversimplified your problem; maybe come up with a more representative, yet still sufficiently simple example? – J. M.'s technical difficulties Mar 3 '19 at 13:20