How to automatically assign the output from the solve function in Maple 17 to variable names

485 Views Asked by At

Years ago while using Maple 11 mathematical software, I accidentally came across a way to automatically assign the output from the solve function into pre-designated variable names.

So that if for example the solve(eq1, x) function returned three solutions for the unknown x value, I could have told the function to label these solutions x_Sol_01, x_Sol_02 and x_Sol_03 automatically.

I currently have access to Maple 17, and will like to implement this capability in a procedure for testing into another procedure.

I will please like to know how this can it be done?

1

There are 1 best solutions below

3
On BEST ANSWER

Do you mean this?

> x_Sol_01, x_Sol_02, x_Sol_03 := solve(..., x); 

Of course, that will only work if you know in advance how many solutions solve will return. If you don't, you could try something like this:

> S := solve(..., x);
  assign(seq(x_Sol_||i,  i = 1..nops([S]))= S);