Skip to main content
Routine clean-up
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

Rules in simplifiedfor simplifying expressions

Let'sI define a simple equationexpression $\Omega(x,y)$$\Omega$:

x1 = m3*Sqrt[3];
y1 = 0;
x2 = Sqrt[3]/2*(2*m3 - 1);
y2 = 1/2;
x3 = x2;
y3 = -y2;

r1 = Sqrt[(x - x1)^2 + (y - y1)^2];
r2 = Sqrt[(x - x2)^2 + (y - y2)^2];  
r3 = Sqrt[(x - x3)^2 + (y - y3)^2];

Ω = (1 - 2*m3)/r1 + m3/r2 + m3/r3 + 1/2*(x^2 + y^2);

ThenI also define some rules:

rule1 = {m3*Sqrt[3] -> x10, 1/2*Sqrt[3]*(2*m3 - 1) -> x20};
rule2 = {((x - x10)^2 + y^2) -> r10, ((x - x20)^2 + (y - 1/2)^2) -> r20,
         ((x - x20)^2 + (y + 1/2)^2) -> r30};

When I compute the first derivative with respect to $x$

Ωx = D[Ω, x];

and I use the rules astry to simplify it after applying my rules; i.e.,

Simplify[Ωx /. rule1 /. rule2]

I get the following output

enter image description here

As you can see, the rules work well in the second term, while on the other hand they fail in the third and fourth term. Why?

Any suggestions on how to simplify the output according to the above-mentioned rules?

Rules in simplified expressions

Let's define a simple equation $\Omega(x,y)$

x1 = m3*Sqrt[3];
y1 = 0;
x2 = Sqrt[3]/2*(2*m3 - 1);
y2 = 1/2;
x3 = x2;
y3 = -y2;

r1 = Sqrt[(x - x1)^2 + (y - y1)^2];
r2 = Sqrt[(x - x2)^2 + (y - y2)^2];  
r3 = Sqrt[(x - x3)^2 + (y - y3)^2];

Ω = (1 - 2*m3)/r1 + m3/r2 + m3/r3 + 1/2*(x^2 + y^2);

Then some rules

rule1 = {m3*Sqrt[3] -> x10, 1/2*Sqrt[3]*(2*m3 - 1) -> x20};
rule2 = {((x - x10)^2 + y^2) -> r10, ((x - x20)^2 + (y - 1/2)^2) -> r20,
         ((x - x20)^2 + (y + 1/2)^2) -> r30};

When I compute the first derivative with respect to $x$

Ωx = D[Ω, x];

and I use the rules as

Simplify[Ωx /. rule1 /. rule2]

I get the following output

enter image description here

As you can see, the rules work well in the second term, while on the other hand they fail in the third and fourth term. Why?

Any suggestions on how to simplify the output according to the above-mentioned rules?

Rules for simplifying expressions

I define a simple expression $\Omega$:

x1 = m3*Sqrt[3];
y1 = 0;
x2 = Sqrt[3]/2*(2*m3 - 1);
y2 = 1/2;
x3 = x2;
y3 = -y2;

r1 = Sqrt[(x - x1)^2 + (y - y1)^2];
r2 = Sqrt[(x - x2)^2 + (y - y2)^2];  
r3 = Sqrt[(x - x3)^2 + (y - y3)^2];

Ω = (1 - 2*m3)/r1 + m3/r2 + m3/r3 + 1/2*(x^2 + y^2);

I also define some rules:

rule1 = {m3*Sqrt[3] -> x10, 1/2*Sqrt[3]*(2*m3 - 1) -> x20};
rule2 = {((x - x10)^2 + y^2) -> r10, ((x - x20)^2 + (y - 1/2)^2) -> r20,
         ((x - x20)^2 + (y + 1/2)^2) -> r30};

When I compute the first derivative with respect to $x$

Ωx = D[Ω, x];

and I try to simplify it after applying my rules; i.e.,

Simplify[Ωx /. rule1 /. rule2]

I get the following output

enter image description here

As you can see, the rules work well in the second term, while on the other hand they fail in the third and fourth term. Why?

Any suggestions on how to simplify the output according to the above-mentioned rules?

added 7 characters in body
Source Link
Vaggelis_Z
  • 8.8k
  • 6
  • 35
  • 81

Let's define a simple equation $\Omega(x,y)$

x1 = m3*Sqrt[3];
y1 = 0;
x2 = Sqrt[3]/2*(2*m3 - 1);
y2 = 1/2;
x3 = x2;
y3 = -y2;

r1 = Sqrt[(x - x1)^2 + (y - y1)^2];
r2 = Sqrt[(x - x2)^2 + (y - y2)^2];  
r3 = Sqrt[(x - x3)^2 + (y - y3)^2];

Ω = (1 - 2*m3)/r1 + m3/r2 + m3/r3 + 1/2*(x^2 + y^2);

Then some rules

rule1 = {m3*Sqrt[3] -> x10, 1/2*Sqrt[3]*(2*m3 - 1) -> x20};
rule2 = {((x - x10)^2 + y^2) -> r10, ((x - x20)^2 + (y - 1/2)^2) -> r20,
         ((x - x20)^2 + (y + 1/2)^2) -> r30};

When I compute the first derivative with respect to $x$

Ωx = D[Ω, x];

and I use the rules as

Simplify[Ωx /. rule1 /. rule2]

I get the following output

enter image description here

As you can see, the rules work well in the second term, while on the other hand they fail in the third and fourth term. Why?

Any suggestions on how to simplify the output according to the above-mentioned rules?

Let's define a simple equation $\Omega(x,y)$

x1 = m3*Sqrt[3];
y1 = 0;
x2 = Sqrt[3]/2*(2*m3 - 1);
y2 = 1/2;
x3 = x2;
y3 = -y2;

r1 = Sqrt[(x - x1)^2 + (y - y1)^2];
r2 = Sqrt[(x - x2)^2 + (y - y2)^2];  
r3 = Sqrt[(x - x3)^2 + (y - y3)^2];

Ω = (1 - 2*m3)/r1 + m3/r2 + m3/r3 + 1/2*(x^2 + y^2);

Then some rules

rule1 = {m3*Sqrt[3] -> x10, 1/2*Sqrt[3]*(2*m3 - 1) -> x20};
rule2 = {((x - x10)^2 + y^2) -> r10, ((x - x20)^2 + (y - 1/2)^2) -> r20,
         ((x - x20)^2 + (y + 1/2)^2) -> r30};

When I compute the first derivative with respect to $x$

Ωx = D[Ω, x];

and I use the rules as

Simplify[Ωx /. rule1 /. rule2]

I get the following

enter image description here

As you can see, the rules work well in the second term, while on the other hand they fail in the third and fourth term. Why?

Any suggestions on how to simplify the output according to the above-mentioned rules?

Let's define a simple equation $\Omega(x,y)$

x1 = m3*Sqrt[3];
y1 = 0;
x2 = Sqrt[3]/2*(2*m3 - 1);
y2 = 1/2;
x3 = x2;
y3 = -y2;

r1 = Sqrt[(x - x1)^2 + (y - y1)^2];
r2 = Sqrt[(x - x2)^2 + (y - y2)^2];  
r3 = Sqrt[(x - x3)^2 + (y - y3)^2];

Ω = (1 - 2*m3)/r1 + m3/r2 + m3/r3 + 1/2*(x^2 + y^2);

Then some rules

rule1 = {m3*Sqrt[3] -> x10, 1/2*Sqrt[3]*(2*m3 - 1) -> x20};
rule2 = {((x - x10)^2 + y^2) -> r10, ((x - x20)^2 + (y - 1/2)^2) -> r20,
         ((x - x20)^2 + (y + 1/2)^2) -> r30};

When I compute the first derivative with respect to $x$

Ωx = D[Ω, x];

and I use the rules as

Simplify[Ωx /. rule1 /. rule2]

I get the following output

enter image description here

As you can see, the rules work well in the second term, while on the other hand they fail in the third and fourth term. Why?

Any suggestions on how to simplify the output according to the above-mentioned rules?

added 17 characters in body
Source Link
Vaggelis_Z
  • 8.8k
  • 6
  • 35
  • 81

Let's define a simple equation $\Omega(x,y)$

x1 = m3*Sqrt[3];
y1 = 0;
x2 = Sqrt[3]/2*(2*m3 - 1);
y2 = 1/2;
x3 = x2;
y3 = -y2;

r1 = Sqrt[(x - x1)^2 + (y - y1)^2];
r2 = Sqrt[(x - x2)^2 + (y - y2)^2];  
r3 = Sqrt[(x - x3)^2 + (y - y3)^2];

Ω = (1 - 2*m3)/r1 + m3/r2 + m3/r3 + 1/2*(x^2 + y^2);

Then some rules

rule1 = {m3*Sqrt[3] -> x10, 1/2*Sqrt[3]*(2*m3 - 1) -> x20};
rule2 = {((x - x10)^2 + y^2) -> r10, ((x - x20)^2 + (y - 1/2)^2) -> r20,
         ((x - x20)^2 + (y + 1/2)^2) -> r30};

When I compute the first derivative with respect to $x$

Ωx = D[Ω, x];

and I use the rules as

Simplify[Ωx /. rule1 /. rule2]

I get the following

enter image description here

As you can see, the rules work well in the second term., while on the other hand they fail in the third and fourth term. Why?

Any suggestions on how to simplify the output according to the above-mentioned rules?

Let's define a simple equation $\Omega(x,y)$

x1 = m3*Sqrt[3];
y1 = 0;
x2 = Sqrt[3]/2*(2*m3 - 1);
y2 = 1/2;
x3 = x2;
y3 = -y2;

r1 = Sqrt[(x - x1)^2 + (y - y1)^2];
r2 = Sqrt[(x - x2)^2 + (y - y2)^2];  
r3 = Sqrt[(x - x3)^2 + (y - y3)^2];

Ω = (1 - 2*m3)/r1 + m3/r2 + m3/r3 + 1/2*(x^2 + y^2);

Then some rules

rule1 = {m3*Sqrt[3] -> x10, 1/2*Sqrt[3]*(2*m3 - 1) -> x20};
rule2 = {((x - x10)^2 + y^2) -> r10, ((x - x20)^2 + (y - 1/2)^2) -> r20,
         ((x - x20)^2 + (y + 1/2)^2) -> r30};

When I compute the first derivative with respect to $x$

Ωx = D[Ω, x];

and I use the rules as

Simplify[Ωx /. rule1 /. rule2]

I get the following

enter image description here

As you can see the rules work well in the second term. while on the other hand they fail in the third and fourth term. Why?

Any suggestions on how to simplify the output according to the rules?

Let's define a simple equation $\Omega(x,y)$

x1 = m3*Sqrt[3];
y1 = 0;
x2 = Sqrt[3]/2*(2*m3 - 1);
y2 = 1/2;
x3 = x2;
y3 = -y2;

r1 = Sqrt[(x - x1)^2 + (y - y1)^2];
r2 = Sqrt[(x - x2)^2 + (y - y2)^2];  
r3 = Sqrt[(x - x3)^2 + (y - y3)^2];

Ω = (1 - 2*m3)/r1 + m3/r2 + m3/r3 + 1/2*(x^2 + y^2);

Then some rules

rule1 = {m3*Sqrt[3] -> x10, 1/2*Sqrt[3]*(2*m3 - 1) -> x20};
rule2 = {((x - x10)^2 + y^2) -> r10, ((x - x20)^2 + (y - 1/2)^2) -> r20,
         ((x - x20)^2 + (y + 1/2)^2) -> r30};

When I compute the first derivative with respect to $x$

Ωx = D[Ω, x];

and I use the rules as

Simplify[Ωx /. rule1 /. rule2]

I get the following

enter image description here

As you can see, the rules work well in the second term, while on the other hand they fail in the third and fourth term. Why?

Any suggestions on how to simplify the output according to the above-mentioned rules?

added 6 characters in body
Source Link
Vaggelis_Z
  • 8.8k
  • 6
  • 35
  • 81
Loading
Source Link
Vaggelis_Z
  • 8.8k
  • 6
  • 35
  • 81
Loading