Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: simultaneous equation
Replies: 5   Last Post: Nov 24, 2012 2:27 AM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Trichy V. Krishnan Posts: 8 Registered: 11/22/12
Re: simultaneous equation
Posted: Nov 23, 2012 3:30 AM
 Plain Text Reply

Thanks Bob. Very helpful!

With regards

trichy

-----Original Message-----
From: Bob Hanlon [mailto:hanlonr357@gmail.com]
Sent: Thursday, November 22, 2012 11:44 PM
To: Trichy V. Krishnan
Cc: mathgroup@smc.vnet.net
Subject: Re: simultaneous equation

Either Rationalize the results or input exact expressions (i.e., Rationalize input).

x1 = 0.5 + (1/(4 t1)) (rsm - rsk);
x2 = 0.5 + (1/(4 t2)) (rLm - rLk);
x3 = 0.5 + (1/4) (rLk - n rsk);
x4 = 0.5 + (1/4) (rLm - n rsm);
ssk = a b x1 + (1 - a) g x3;
sLk = a (1 - b) x2 + (1 - a) g (1 - x3); ssm = a b (1 - x1) + (1 - a) (1 - g) x4; sLm = a (1 - b) (1 - x2) + (1 - a) (1 - g) (1 - x4); Pik = ssk rsk + sLk rLk; Pim = ssm rsm + sLm rLm; Pidsm = D[Pim, rsm]; PidLm = D[Pim, rLm];
sol1 = Solve[Pidsm == 0 && PidLm == 0, {rsm, rLm}][[1]] // Rationalize //
Simplify

{rsm -> -(1/
t12 (-2 (-1 + g) t1 +
a (2 (-1 + g) t1 + b (rsk + 2 t1))) ((-1 + g) t2 +
a (-1 + b + t2 - g t2)) - (-1 + a) (-1 + g) (1 + n) (-2 (-1 + g) t2 +
a (rLk - b rLk + 2 (-b + g) t2)))/(16 t2 (-(1/
16) (-1 + a)^2 (-1 + g)^2 (1 + n)^2 -
1/(4 t1 t2)(-(-1 + g) n t1 + a (b + (-1 + g) n t1)) ((-1 + g) t2 +
a (-1 + b + t2 - g t2)))),
rLm -> (-2 (-1 + g)^2 (1 + 3 n) t1 t2 +
a (-1 + g) ((4 (-1 + g) t1 + b (4 + rsk + 2 t1)) t2 +
n (-2 (-1 + b) rLk t1 + (b rsk - 8 t1 - 2 b t1 + 12 g t1) t2)) +
a^2 (2 b^2 (rLk + 2 t2) +
b (2 rLk (-1 + (-1 + g) n t1) + (rsk + n rsk + 2 t1 - 2 n t1 -
g (4 + rsk + n rsk + 2 t1 - 2 n t1)) t2) -
2 (-1 + g) t1 ((-1 + g) t2 + n (rLk - t2 + 3 g t2))))/((-1 +
g)^2 (-1 + n)^2 t1 t2 -
2 a (-1 + g) ((-1 + g) n^2 t1 t2 - (2 b + t1 - g t1) t2 +
2 n t1 (-1 + b + t2 - g t2)) +
a^2 (4 b^2 +
4 b (-1 + (-1 + g) n t1 + t2 - g t2) + (-1 +
g) t1 ((-1 + g) t2 + (-1 + g) n^2 t2 - 2 n (2 + (-1 + g) t2))))}

x1 = 1/2 + (1/(4 t1)) (rsm - rsk);
x2 = 1/2 + (1/(4 t2)) (rLm - rLk);
x3 = 1/2 + (1/4) (rLk - n rsk);
x4 = 1/2 + (1/4) (rLm - n rsm);
ssk = a b x1 + (1 - a) g x3;
sLk = a (1 - b) x2 + (1 - a) g (1 - x3); ssm = a b (1 - x1) + (1 - a) (1 - g) x4; sLm = a (1 - b) (1 - x2) + (1 - a) (1 - g) (1 - x4); Pik = ssk rsk + sLk rLk; Pim = ssm rsm + sLm rLm; Pidsm = D[Pim, rsm]; PidLm = D[Pim, rLm];
sol2 = Solve[Pidsm == 0 && PidLm == 0, {rsm, rLm}][[1]] // Simplify;

({rsm, rLm} /. sol1) == ({rsm, rLm} /. sol2)

True

Bob Hanlon

On Thu, Nov 22, 2012 at 4:33 AM, Trichy V. Krishnan <biztvk@nus.edu.sg> wrote:
> Hi:
>
> When I solve a simultaneous equation, the output looks as follows. How do I remove those ?1.? and the annoying wiggles in the superscript position in so many places.
>
> With regards
>
> trichy
>
> Here is the whole thing. It's a small program... When I ran it anew, the superscript-wiggles are gone but the "1." persists. Thanks for the help.
> trichy
>
> In[1]:
> x1 = 0.5 + (1/(4 t1)) (rsm - rsk);
> x2 = 0.5 + (1/(4 t2)) (rLm - rLk);
> x3 = 0.5 + (1/4) (rLk - n rsk);
> x4 = 0.5 + (1/4) (rLm - n rsm);
> ssk = a b x1 + (1 - a) g x3;
> sLk = a (1 - b) x2 + (1 - a) g (1 - x3); ssm = a b (1 - x1) + (1 - a)
> (1 - g) x4; sLm = a (1 - b) (1 - x2) + (1 - a) (1 - g) (1 - x4); Pik =
> ssk rsk + sLk rLk; Pim = ssm rsm + sLm rLm; Pidsm = D[Pim, rsm]; PidLm
> = D[Pim, rLm]; Solve[Pidsm == 0 && PidLm == 0, {rsm, rLm}]
>
> Out[1]:
> {{rsm -> -((0.5 a b + 0.5 (1. - 1. a) (1. - 1. g) + (0.25 a b rsk)/
> t1) (-0.5 (1. - 1. a) (1. - 1. g) - (0.5 a (1. - 1. b))/
> t2) - 1. (0.25 (1. - 1. a) (1. - 1. g) +
> 0.25 (1. - 1. a) (1. - 1. g) n) (0.5 a (1. - 1. b) +
> 0.5 (1. - 1. a) (1. - 1. g) + (0.25 a (1. - 1. b) rLk)/
> t2))/(-1. (0.25 (1. - 1. a) (1. - 1. g) +
> 0.25 (1. - 1. a) (1. - 1. g) n)^2 + (-0.5 (1. - 1. a) (1. -
> 1. g) n - (0.5 a b)/t1) (-0.5 (1. - 1. a) (1. - 1. g) - (
> 0.5 a (1. - 1. b))/t2)),
> rLm -> (1. (0.25 (1. - 1. a) (1. - 1. g) +
> 0.25 (1. - 1. a) (1. - 1. g) n) ((0.5 a b +
> 0.5 (1. - 1. a) (1. - 1. g) + (0.25 a b rsk)/
> t1) (-0.5 (1. - 1. a) (1. - 1. g) - (0.5 a (1. - 1. b))/
> t2) - 1. (0.25 (1. - 1. a) (1. - 1. g) +
> 0.25 (1. - 1. a) (1. - 1. g) n) (0.5 a (1. - 1. b) +
> 0.5 (1. - 1. a) (1. - 1. g) + (0.25 a (1. - 1. b) rLk)/
> t2)))/((-1. (0.25 (1. - 1. a) (1. - 1. g) +
> 0.25 (1. - 1. a) (1. - 1. g) n)^2 + (-0.5 (1. -
> 1. a) (1. - 1. g) n - (0.5 a b)/
> t1) (-0.5 (1. - 1. a) (1. - 1. g) - (0.5 a (1. - 1. b))/
> t2)) (-0.5 (1. - 1. a) (1. - 1. g) - (0.5 a (1. - 1. b))/
> t2)) - (0.5 a (1. - 1. b) + 0.5 (1. - 1. a) (1. - 1. g) + (
> 0.25 a (1. - 1. b) rLk)/t2)/(-0.5 (1. - 1. a) (1. - 1. g) - (
> 0.5 a (1. - 1. b))/t2)}}

Date Subject Author
11/22/12 Trichy V. Krishnan
11/23/12 Nasser Abbasi
11/24/12 Alexei Boulbitch
11/23/12 Bob Hanlon
11/23/12 Trichy V. Krishnan

© The Math Forum at NCTM 1994-2018. All Rights Reserved.