Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a question that seems easy but I can't solve it. I have an equation like:

eqgama = -8.33208*10^56 g1 + 8.18264*10^56 g1^2 == -1.42093*10^56

I use the following statements to find its discriminant:

poly = (eqgama[[1]] - eqgama[[2]]) // Simplify;
Discriminant[poly, g1];

The answer is: 2.29158*10^113

In another program mathematica itself simplifies eqgama to the following equation:

-1.97163*10^54 g1 + 1.93627*10^54 g1 ^2 == -3.36235*10^53

and so the discriminant becomes: 1.28315*10^108.

I have a loop and I want to plot discriminants versus a definite parameter, but in this loop sometimes Mathematica simplifies equations and sometimes not. So the plot fluctuates. What should I do?

share|improve this question

closed as not a real question by belisarius, acl, rm -rf, Verbeia, Sjoerd C. de Vries Aug 6 '12 at 21:19

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
Don't use subscripts... Rewrite your equations without them and update the code in your question –  rm -rf Aug 4 '12 at 19:16
1  
Your title could be better. The question isn't about simplification of equations as far as I can see. You claim to have problems with a loop and with plotting without specifying either. You should really try to improve and clarify your question or risk that it be closed. –  Sjoerd C. de Vries Aug 4 '12 at 22:19

1 Answer 1

Discriminants are not scale free.

If you do

Discriminant[100 (x - a) (x - b), x] - Discriminant[(x - a) (x - b), x] // FullSimplify

you get

9999 (a - b)^2

So, what you can do is to transform your equations into monomials. Trying to respect your notation (which is not the better):

eqgama[1] = -8.33208*10^56 g1 + 8.18264*10^56 g1^2 == -1.42093*10^56;
eqgama[2] = -1.97163*10^54 g1 + 1.93627*10^54 g1^2 == -3.36235*10^53;

c2[x_] := Coefficient[x, g1, 2]
disc[x_] := Discriminant[#/c2[#], g1] &@(x[[1]] - x[[2]])

then:

disc /@ eqgama /@ {1,2}
(*
{0.342253, 1.03686}
*)

Edit

For plotting such things with a parameter, you could do something like:

eqgama[t_] := Cos@t  g1 + Tan@t g1^2 == Gamma@t; (* an example*)

Plot[disc@eqgama@t, {t, 0, 3}]

Mathematica graphics

Edit

Also, please remember that Mathematica has many powerful tools to study parametric equations behavior.

Following with our toy example:

h[t_, g1_] := Cos@t g1 + Tan@t g1^2 - Gamma@t;
Grid[{Through[{Plot3D,DensityPlot,ContourPlot}[h[t,g], {t,0,Pi}, {g,0,5}]]}, Frame -> All]

Mathematica graphics

share|improve this answer
    
thanks for your helpful answer. –  Soodeh Z. Aug 4 '12 at 20:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.