can't solve the equations



On Wed, Jun 2, 2010 at 2:37 PM, Leo Butler <l.butler at ed.ac.uk> wrote:

>
>
> On Wed, 2 Jun 2010, ultrokevjr wrote:
>
> < to resolve the following equations under maxima 5.21.1 with wxmaxima as
> gui:
> <
> <
> eq1:(y[i]-y[1])/(y[1]-y[2])=y[1]*(1+K[L]*rho*y[2])/y[2]/(1+K[L]*rho*y[1]);
> <
> eq2:(y[i]-y[1])/(y[2]-y[f])=y[1]*(1+K[L]*rho*y[f])/y[f]/(1+K[L]*rho*y[1]);
> <
> ev(solve([eq1,eq2],[y[1],y[2]]),float,y[i]=0.158,y[f]=0.047,rho=1000,K[L]=0.001294);
> <
> < wxmaxima just shows `maxima is calculating` after almost ten hours.
> <
> < while maple 13.02 gives the result almost immediately:
> <
> < eq1:(y[i]-y[1])/(y[1]-y[2])=y[1]*(1+K[L]*rho*y[2])/y[2]/(1+K[L]*rho*y[1])
> < eq2:(y[i]-y[1])/(y[2]-y[f])=y[1]*(1+K[L]*rho*y[f])/y[f]/(1+K[L]*rho*y[1])
> < evalf(eval(solve({eq1, eq2}, [y[1], y[2]]), [y[i] = 0.158, y[f] = 0.47,
> rho = 1000, K[L] = 0.129]))
> <
> < [[y[1] = 0.1067788429, y[2] = 0.07118961648]]
> <
> < So, is it possible adjust maxima parameters to faster the calculate, or
> it's just due to lack of certain optimization?
> <
> <
>
> I don't find any difficulty in solving this problem:
> (%i1) build_info();
>
> Maxima version: 5.21.1
> Maxima build date: 20:11 5/9/2010
> Host type: i686-pc-linux-gnu
> Lisp implementation type: CMU Common Lisp
> Lisp implementation version: CVS 19d 19d-release (19D)
>
> (%o1) ""
> (%i2)
> eq1:(y[i]-y[1])/(y[1]-y[2])=y[1]*(1+K[L]*rho*y[2])/y[2]/(1+K[L]*rho*y[1]);
>
> (%o2) (y[i]-y[1])/(y[1]-y[2]) = y[1]*(y[2]*rho*K[L]+1)
>                              /(y[2]*(y[1]*rho*K[L]+1))
> (%i3)
> eq2:(y[i]-y[1])/(y[2]-y[f])=y[1]*(1+K[L]*rho*y[f])/y[f]/(1+K[L]*rho*y[1]);
>
>
> (%o3) (y[i]-y[1])/(y[2]-y[f]) = y[1]*(y[f]*rho*K[L]+1)
>                              /(y[f]*(y[1]*rho*K[L]+1))
> (%i4) showtime:true$
> Evaluation took 0.0000 seconds (0.0000 elapsed) using 32 bytes.
> (%i5)
>
> ev(solve([eq1,eq2],[y[1],y[2]]),float,y[i]=0.158,y[f]=0.047,rho=1000,K[L]=0.001294);
> Evaluation took 0.0700 seconds (0.0700 elapsed) using 1.373 MB.
> (%o5) [[y[1] = .1067788383756674,y[2] = .07118961595075605],
>       [y[1] = -.07862590085875154*%i-.06536849090072218,
>        y[2] = .05715217932542285*%i-.02826732059625807],
>       [y[1] = .07862590085875155*%i-.06536849090072218,
>        y[2] = -.05715217932542285*%i-.02826732059625807],
>       [y[1] = 6.863414634146341,y[2] = -0.380715123094959]]
>
> Could you try doing this computation in either Xmaxima or command-line
> Maxima, please.
>
> Leo
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>

very sorry about mistake in the former post(eval the result of solve will
trigger the problem, however, eval together with solve express just works
like a charm):

eq1:(y[i]-y[1])/(y[1]-y[2])=y[1]*(1+K[L]*rho*y[2])/y[2]/(1+K[L]*rho*y[1]);
eq2:(y[i]-y[1])/(y[2]-y[f])=y[1]*(1+K[L]*rho*y[f])/y[f]/(1+K[L]*rho*y[1]);
solve([eq1,eq2],[y[1],y[2]]); --------- stumbled here
ev(%,float,y[i]=0.158,y[f]=0.047,rho=1000,K[L]=0.001294);