Skip to main content
added 101 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29

Solutions returned by Solve are provided as rules:

solnRule1 = 
  y -> 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

Solutions returned by Reduce are provided as equations:

solnEqn1 = 
  y == 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

It has been my experience that Simplify treats both of these the same:

Simplify@solnRule1
Simplify@solnEqn1

enter image description here

However, that is not the case for these identical solutions:

 solnRule2 = 
  y -> -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));
 solnEqn2 = 
  y == -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));

When Simplify is applied to the rule-based version of the above solution, it acts normally:

Simplify@solnRule2

enter image description here

But when Simplify is applied to the equation-based version, it equates the solution to zero:

Simplify@solnEqn2

enter image description here

I don't know why Simplify is doing this. When I convert solnEqn2 to a rule-based format, it behaves normally:

ToRules@solnEqn2
Simplify@%

enter image description here

This can cause problems when applying Simplify to the output of Reduce: Reduce can provide solutions to several different variables, and when one solution is equated to zero it can be difficult to determine the variable it represents.

I'm using:

enter image description here

Solutions returned by Solve are provided as rules:

solnRule1 = 
  y -> 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

Solutions returned by Reduce are provided as equations:

solnEqn1 = 
  y == 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

It has been my experience that Simplify treats both of these the same:

Simplify@solnRule1
Simplify@solnEqn1

enter image description here

However, that is not the case for these identical solutions:

 solnRule2 = 
  y -> -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));
 solnEqn2 = 
  y == -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));

When Simplify is applied to the rule-based version of the above solution, it acts normally:

Simplify@solnRule2

enter image description here

But when Simplify is applied to the equation-based version, it equates the solution to zero:

Simplify@solnEqn2

enter image description here

I don't know why Simplify is doing this. When I convert solnEqn2 to a rule-based format, it behaves normally:

ToRules@solnEqn2
Simplify@%

enter image description here

This can cause problems when applying Simplify to the output of Reduce: Reduce can provide solutions to several different variables, and when one solution is equated to zero it can be difficult to determine the variable it represents.

Solutions returned by Solve are provided as rules:

solnRule1 = 
  y -> 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

Solutions returned by Reduce are provided as equations:

solnEqn1 = 
  y == 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

It has been my experience that Simplify treats both of these the same:

Simplify@solnRule1
Simplify@solnEqn1

enter image description here

However, that is not the case for these identical solutions:

 solnRule2 = 
  y -> -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));
 solnEqn2 = 
  y == -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));

When Simplify is applied to the rule-based version of the above solution, it acts normally:

Simplify@solnRule2

enter image description here

But when Simplify is applied to the equation-based version, it equates the solution to zero:

Simplify@solnEqn2

enter image description here

I don't know why Simplify is doing this. When I convert solnEqn2 to a rule-based format, it behaves normally:

ToRules@solnEqn2
Simplify@%

enter image description here

This can cause problems when applying Simplify to the output of Reduce: Reduce can provide solutions to several different variables, and when one solution is equated to zero it can be difficult to determine the variable it represents.

I'm using:

enter image description here

edited body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29

Solutions returned by Solve are provided as Rulesrules:

solnRule1 = 
  y -> 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

Solutions returned by Reduce are provided as equations:

solnEqn1 = 
  y == 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

It ishas been my understandingexperience that Simplify's standard behavior is to treatSimplify treats both of these the same:

Simplify@solnRule1
Simplify@solnEqn1

enter image description here

However, that is not the case for these identical solutions:

 solnRule2 = 
  y -> -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));
 solnEqn2 = 
  y == -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));

When Simplify is applied to the rule-based version of the above solution, it acts normally:

Simplify@solnRule2

enter image description here

But when Simplify is applied to the equation-based version, it equates the solution to zero:

Simplify@solnEqn2

enter image description here

I don't know why Simplify is doing this. When I convert solnEqn2 to a rule-based format, it behaves normally:

ToRules@solnEqn2
Simplify@%

enter image description here

This can cause problems when applying Simplify to the output of Reduce: Reduce can provide solutions to several different variables, and when one solution is equated to zero it can be difficult to determine the variable it represents.

Solutions returned by Solve are provided as Rules:

solnRule1 = 
  y -> 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

Solutions returned by Reduce are provided as equations:

solnEqn1 = 
  y == 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

It is my understanding that Simplify's standard behavior is to treat both of these the same:

Simplify@solnRule1
Simplify@solnEqn1

enter image description here

However, that is not the case for these identical solutions:

 solnRule2 = 
  y -> -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));
 solnEqn2 = 
  y == -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));

When Simplify is applied to the rule-based version of the above solution, it acts normally:

Simplify@solnRule2

enter image description here

But when Simplify is applied to the equation-based version, it equates the solution to zero:

Simplify@solnEqn2

enter image description here

I don't know why Simplify is doing this. When I convert solnEqn2 to a rule-based format, it behaves normally:

ToRules@solnEqn2
Simplify@%

enter image description here

This can cause problems when applying Simplify to the output of Reduce: Reduce can provide solutions to several different variables, and when one solution is equated to zero it can be difficult to determine the variable it represents.

Solutions returned by Solve are provided as rules:

solnRule1 = 
  y -> 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

Solutions returned by Reduce are provided as equations:

solnEqn1 = 
  y == 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

It has been my experience that Simplify treats both of these the same:

Simplify@solnRule1
Simplify@solnEqn1

enter image description here

However, that is not the case for these identical solutions:

 solnRule2 = 
  y -> -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));
 solnEqn2 = 
  y == -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));

When Simplify is applied to the rule-based version of the above solution, it acts normally:

Simplify@solnRule2

enter image description here

But when Simplify is applied to the equation-based version, it equates the solution to zero:

Simplify@solnEqn2

enter image description here

I don't know why Simplify is doing this. When I convert solnEqn2 to a rule-based format, it behaves normally:

ToRules@solnEqn2
Simplify@%

enter image description here

This can cause problems when applying Simplify to the output of Reduce: Reduce can provide solutions to several different variables, and when one solution is equated to zero it can be difficult to determine the variable it represents.

deleted 1920 characters in body; edited tags; edited title
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29

Why does Simplify equate thistreats a solution to zero?differently when it's formatted as an equation instead of a rule

For this question, I've borrowed the system of equations presented in Solving for a single variable across multiple equations. I've converted all values to exact numbers, to provide both Solve and Reduce with exact input.

I've found that, when Simplify is applied to the solution provided by Reduce, the solution disappears; this appears to be because Simplify equates the solution to zero. Simplify does not do this for the solution produceSolutions returned by Solve, even though its solution is equivalent.

The following (undocumented) syntax means: "Using reduce, solve the given system of equations for $\sigma \mathrm M$, while elminating VF and Vs are provided as Rules:

redsolnRule1 = Reduce[
  Log10[fy -> 1/(3 (1 -+ fx)] == pH) - pKa(-1 + F2 Vsx)/(23/106 R(1 T)- &&x \[Sigma]M+ ==x^2)) 
 + 2/(
 cF VF && Ee3 -(1 Epzc+ ==1/3 VF(-1 + Vs, \[Sigma]M, {Vs,2 VF}]x)^2));

enter image description here

If I apply Simplify to the above, the solution for $\sigma \mathrm M$ is simplified, but it's no longer displayedSolutions returned by Reduce are provided as being the solution to $\sigma \mathrm M$; instead, it's equated to zeroequations:

simpRedsolnEqn1 = Simplify@red

enter image description here

This can be seen if we pull out the solution for $\sigma \mathrm M$ and apply Simplify specifically to it:

redSigmaM = red[[3, 2]]
Simplify@redSigmaM

enter image description here

I don't know why Simplify is doing this, because when I apply Simplify just to the RHS of Reduce's solution for $\sigma \mathrm M$ (RHSredSigmaM), it doesn't equate it to zero. While RHSredSigmaM does equal zero under the specific conditions that cF = 0, or Ee = Epzc and either R = 0 or T = 0, it does not appear that it is generically equal to zero:

RHSredSigmaMy === redSigmaM[[2]]
simpRHSredSigmaM1/(3 =(1 Simplify@RHSredSigmaM
RHSredSigmaM+ /.x)) cF- (->1 0
RHSredSigmaM+ 2 x)/.(6 {Ee(1 -> Epzc,x R+ ->x^2)) 0}
RHSredSigmaM+ 2/.(
 {Ee -> Epzc, T3 (1 + 1/3 (->1 0}+ 2 x)^2));

enter image description here

Note It is my understanding that thisSimplify's standard behavior is not due to my usetreat both of undocumented syntax with Reduce, sincethese the same thing happens with standard syntax. I chose to use the undocumented syntax because it allowed me to more clearly focus just on the solution to $\sigma \mathrm M$. With the following standard syntax, I get other solutions as well:

Simplify@solnRule1
Simplify@solnEqn1

enter image description here

However, makingthat is not the case for a messier output (suppressed here) and thus a less readable postthese identical solutions:

red2 solnRule2 = Reduce[
   Log10[f/(1y -> f)]-((-10 ==cF pHEe -F pKaLog[10] + 10 cF Epzc F Vs/(23/10Log[10] R- T) 
 && \[Sigma]M ==  23 cF VFpH &&R 
 T Log[10] + 23 EecF -pKa EpzcR ==T VFLog[10] + Vs, 
 {\[Sigma]M, Vs, VF}];
Simplify@red2

enter image description here

I don't see this issue with the output of Solve. Solve's solution for $\sigma \mathrm M$ is initially in a different form from Reduce's, which could explain why Simplify doesn't show the same behavior with Solve.

sol = Solve[
23 cF Log10[fR T Log[f/(1 - f)])/(10 ==F pHLog[10]));
 solnEqn2 = 
  y == -((-10 pKacF Ee F Log[10] + 10 cF Epzc F Vs/(Log[10] - 
     23/10 cF pH R T) &&Log[10] \[Sigma]M+ ==23 cF VFpKa &&R 
 T Log[10] + Ee 
 - Epzc == VF +23 Vs,cF \[Sigma]M,R {Vs,T VF}Log[f/(1 - f)]
simpSol)/(10 =F Simplify@solLog[10]));

enter image description here When Simplify is applied to the rule-based version of the above solution, it acts normally:

Simplify@solnRule2

Neverthelessenter image description here

But when Simplify is applied to the equation-based version, it equates the solution to zero:

Simplify@solnEqn2

enter image description here

I don't know why Simplify is doing this. When I convert solnEqn2 to a comparison of simpRHSredSigmaM and simpRHSsolSigmaM using SameQ shows they are identicalrule-based format, it behaves normally:

simpRHSsolSigmaM = simpSol[[1, 1, 2]]ToRules@solnEqn2
simpRHSredSigmaM === simpRHSsolSigmaMSimplify@%

enter image description hereenter image description here

[simpRHSsolSigmaM $\equiv$ applyThis can cause problems when applying Simplify to the RHSoutput of Solve'sReduce: Reduce can provide solutions to several different variables, and when one solution for $\sigma \mathrm M$; simpRHSredSigmaM $\equiv$ apply Simplifyis equated to zero it can be difficult to determine the RHS of Reduces's solution for $\sigma \mathrm M$]variable it represents.

Why does Simplify equate this solution to zero?

For this question, I've borrowed the system of equations presented in Solving for a single variable across multiple equations. I've converted all values to exact numbers, to provide both Solve and Reduce with exact input.

I've found that, when Simplify is applied to the solution provided by Reduce, the solution disappears; this appears to be because Simplify equates the solution to zero. Simplify does not do this for the solution produce by Solve, even though its solution is equivalent.

The following (undocumented) syntax means: "Using reduce, solve the given system of equations for $\sigma \mathrm M$, while elminating VF and Vs:

red = Reduce[
  Log10[f/(1 - f)] == pH - pKa + F Vs/(23/10 R T) && \[Sigma]M == 
   cF VF && Ee - Epzc == VF + Vs, \[Sigma]M, {Vs, VF}]

enter image description here

If I apply Simplify to the above, the solution for $\sigma \mathrm M$ is simplified, but it's no longer displayed as being the solution to $\sigma \mathrm M$; instead, it's equated to zero:

simpRed = Simplify@red

enter image description here

This can be seen if we pull out the solution for $\sigma \mathrm M$ and apply Simplify specifically to it:

redSigmaM = red[[3, 2]]
Simplify@redSigmaM

enter image description here

I don't know why Simplify is doing this, because when I apply Simplify just to the RHS of Reduce's solution for $\sigma \mathrm M$ (RHSredSigmaM), it doesn't equate it to zero. While RHSredSigmaM does equal zero under the specific conditions that cF = 0, or Ee = Epzc and either R = 0 or T = 0, it does not appear that it is generically equal to zero:

RHSredSigmaM = redSigmaM[[2]]
simpRHSredSigmaM = Simplify@RHSredSigmaM
RHSredSigmaM /. cF -> 0
RHSredSigmaM /. {Ee -> Epzc, R -> 0}
RHSredSigmaM /. {Ee -> Epzc, T -> 0}

enter image description here

Note that this is not due to my use of undocumented syntax with Reduce, since the same thing happens with standard syntax. I chose to use the undocumented syntax because it allowed me to more clearly focus just on the solution to $\sigma \mathrm M$. With the following standard syntax, I get other solutions as well, making for a messier output (suppressed here) and thus a less readable post:

red2 = Reduce[
   Log10[f/(1 - f)] == pH - pKa + F Vs/(23/10 R T) && \[Sigma]M == cF VF && 
     Ee - Epzc == VF + Vs, {\[Sigma]M, Vs, VF}];
Simplify@red2

enter image description here

I don't see this issue with the output of Solve. Solve's solution for $\sigma \mathrm M$ is initially in a different form from Reduce's, which could explain why Simplify doesn't show the same behavior with Solve.

sol = Solve[
  Log10[f/(1 - f)] == pH - pKa + F Vs/(23/10 R T) && \[Sigma]M == cF VF && 
    Ee - Epzc == VF + Vs, \[Sigma]M, {Vs, VF}]
simpSol = Simplify@sol

enter image description here

Nevertheless, a comparison of simpRHSredSigmaM and simpRHSsolSigmaM using SameQ shows they are identical:

simpRHSsolSigmaM = simpSol[[1, 1, 2]]
simpRHSredSigmaM === simpRHSsolSigmaM

enter image description here

[simpRHSsolSigmaM $\equiv$ apply Simplify to the RHS of Solve's solution for $\sigma \mathrm M$; simpRHSredSigmaM $\equiv$ apply Simplify to the RHS of Reduces's solution for $\sigma \mathrm M$]

Simplify treats a solution differently when it's formatted as an equation instead of a rule

Solutions returned by Solve are provided as Rules:

solnRule1 = 
  y -> 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

Solutions returned by Reduce are provided as equations:

solnEqn1 = 
  y == 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

It is my understanding that Simplify's standard behavior is to treat both of these the same:

Simplify@solnRule1
Simplify@solnEqn1

enter image description here

However, that is not the case for these identical solutions:

 solnRule2 = 
  y -> -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] -  
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] +  
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));
 solnEqn2 = 
  y == -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] +  
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));

When Simplify is applied to the rule-based version of the above solution, it acts normally:

Simplify@solnRule2

enter image description here

But when Simplify is applied to the equation-based version, it equates the solution to zero:

Simplify@solnEqn2

enter image description here

I don't know why Simplify is doing this. When I convert solnEqn2 to a rule-based format, it behaves normally:

ToRules@solnEqn2
Simplify@%

enter image description here

This can cause problems when applying Simplify to the output of Reduce: Reduce can provide solutions to several different variables, and when one solution is equated to zero it can be difficult to determine the variable it represents.

added 199 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
deleted 56 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
deleted 56 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 3 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 3 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
deleted 445 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 475 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 475 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 733 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 127 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
added 502 characters in body
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading
Source Link
theorist
  • 3.6k
  • 1
  • 16
  • 29
Loading