On Tue, Oct 30, 2012 at 12:17:35PM +0000, Leo Butler wrote:
> > I notice it does not really work with the trig equations
> > though. Probably because solve () only gives one real solution and
> > %solve gives a solution in the form of union.
> >
> > Is it best for now just to sub values into those general solutions from
> > %solve () by hand?
>
> This is difficult for me to say, partly because I don't use %solve,
> partly because I think that the output of %solve is a little difficult
> to manipulate. However, to my mind, it should be possible to handle most
> cases programmatically.
Hi Leo,
Yes, I understand - it does seem more difficult to manipulate.
> If you could give the list an example where the solution involves arbitary
> parameters, maybe someone could pipe in.
So do you mean something like this?
%solve(sin(x)=1/2,x);
(%o2) %union([x = 2*%pi*%z6+%pi/6],[x = 2*%pi*%z8+5*%pi/6])
(%i3) f(%z6):=2*%pi*%z6+%pi/6;
(%o3) f(%z6):=2*%pi*%z6+%pi/6
(%i4) g(%z8):=2*%pi*%z8+5*%pi/6;
(%o4) g(%z8):=2*%pi*%z8+5*%pi/6
/* find solutions in the domain -2*%pi to 2*%pi */
(%i6) f(-1);
(%o6) -11*%pi/6
(%i7) f(0);
(%o7) %pi/6
(%i10) g(-1);
(%o10) -7*%pi/6
(%i11) g(0);
(%o11) 5*%pi/6
Not really sure if this is what you meant though. I also sometimes sub
values outside the domain into the functions such as -2 in f() to try
and find the last solution. So if somehow there is a way to get this
done automatically it would be quite handy. i.e. all real solutions
between -2*%pi and 2*%pi.
Thanks again for your help.
Dan