Reputation: 572
After some complicated integration maple gives a list of solutions defined on different domains of variables. I need to select just one of them. Domains are so complicated that assuming
is not helpful: maple runs out of memory trying to figure out how these assumptions correspond to domains he found. However, it is pretty obvious, which solution I need.
Is it possible in maple to extract somehow solution by its number or just drop undefined solutions making maple to forget about domain where it is defined?
P.S. It is hard to copy-paste this solution as it is pretty long.
UPD Minimal working example:
> sln := int(1/x, x=a..b,AllSolutions):
> value(sln) assuming a>0, b>0;
{ -ln(a) + ln(b) a < b
{
{ 0 b = a
{
{ -ln(a) + ln(b) b < a
In this patricular example adding assuming a<b
would help, but I would like to get ln(b)-ln(a)
directly.
Upvotes: 0
Views: 1264
Reputation: 2017
Have a look at convert
. It can take your piecewise system and transform it to an array.
> sln := int(1/x, x=a..b,AllSolutions):
> s:=value(sln) assuming a>0, b>0;
{ -ln(a) + ln(b) a < b
{
s := { 0 b = a
{
{ -ln(a) + ln(b) b < a
> conv:=convert(s,list);
conv := [a < b, -ln(a) + ln(b), b = a, 0, b < a, -ln(a) + ln(b)]
> conv[2];
-ln(a) + ln(b)
You can select your favorite part by giving the right (even) index into the array or by matching the odd ones for the part you want (and then select the corresponding even one).
Upvotes: 1