2
$\begingroup$

I have a system of equations given by:

Clear[Eph, q1, q2];
Eeff1 = 782; Eeff2 = 847;
Ereal1 = 880; Ereal2 = 1141;
eq1 = Eeff1 == (Exp[Eph/207]*Ereal1 - q1*Eph)/(Exp[Eph/207] - 1);
eq2 = Eeff2 == (Exp[Eph/207]*Ereal2 - q2*Eph)/(Exp[Eph/207] - 1);

How can I find a pair of (q1,q2) whole numbers that gives the best real solution for the system {eq1,eq2}? By plotting the equations, I found that q1=4 and q2=7 seem to work so that Eph≈300.

$\endgroup$
3
  • $\begingroup$ Ephisn't defined? $\endgroup$ Aug 26, 2020 at 10:19
  • $\begingroup$ Not in principle. But it's a positive number larger than 207. Once the pair of (q1,q2) is determined, it should be the same Eph for both equations. $\endgroup$
    – Rodrigo
    Aug 26, 2020 at 10:23
  • $\begingroup$ What specifically are the equations to solve? $\endgroup$ Aug 26, 2020 at 11:46

1 Answer 1

4
$\begingroup$

First solve the equations for q1[Eph],q2[Eph] and define the parametric curve

Q[Eph_] := {q1, q2} /. Solve[{eq1, eq2}, {q1, q2}][[1]]
 

NMinimize solves for the optimal parameters q1,q2(nearly integer)

opt=NMinimize[{Norm[Round[Q[Eph]] - Q[Eph]], 100 < Eph < 400}, Eph]
(*{0.000912665, {Eph -> 299.679}}*) 

Q[Eph /.opt[[2]]]
(*{4.0004, 6.99918}*)

addendum

direct solution (one step)

NMinimize[{ #.# &[{782 - (880 E^(Eph/207) - Eph q1)/(-1 + E^(Eph/207)),847 - (1141 E^(Eph/207) - Eph q2)/(-1 + E^(Eph/207))}],
Element[{q1, q2}, Integers], 0 < Eph < 500}, {q1, q2, Eph}]
(*{0.00706728, {q1 -> 4, q2 -> 7, Eph -> 299.679}}*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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