0
$\begingroup$

Have trouble to solve this equation. Anybody knows where're the problems?

h = 663*^-36;
c = 3*^8;
k = 138*^-25;
l[λ_] :=Function[y, (2*h c^2/λ^5)/(Exp[h c/(λ k y)] - 1)];
a = Table[x, {x, 400, 700, 10}]*10^-9;
v = Rationalize[{0.0004, 0.0012, 0.0040, 0.0116, 0.0230, 0.0380, 
0.0600, 0.0910, 0.1390, 0.2080, 0.3230, 0.5030, 0.7100, 0.8620, 
0.9540, 0.9950, 0.9950, 0.9520, 0.8700, 0.7570, 0.6310, 0.5030, 
0.3810, 0.2650, 0.1750, 0.1070, 0.0610, 0.0320, 0.0170, 0.0082, 
0.0041}];
lx = l[a];
lt = lx[t]
de = Sum[lt[[k]]*v[[k]], {k, 1, 31}]
dr = Rationalize[de]
Solve[dr == 1/683*10^5, t, Reals]

The program will running for very long time without final output.

Thanks for your help.

$\endgroup$
8
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    Commented Oct 13, 2015 at 1:49
  • $\begingroup$ Table[{t, N[dr]-1/683*10^5}, {t,1,1000}] to see why Solve might be having a difficult problem. Then FindRoot[dr - 1/683*10^5, {t, 750}] $\endgroup$
    – Bill
    Commented Oct 13, 2015 at 2:04
  • $\begingroup$ @Bill Thank you for your help. It worked out. But, why can't we get the result directly by using Solve command? $\endgroup$
    – Andrew
    Commented Oct 13, 2015 at 2:12
  • $\begingroup$ @Andrew Try to solve it by hand and you'll see ... $\endgroup$ Commented Oct 13, 2015 at 2:17
  • $\begingroup$ @Bill I think I got it. Thank you! $\endgroup$
    – Andrew
    Commented Oct 13, 2015 at 2:18

1 Answer 1

2
$\begingroup$

I believe that you will need to use a numeric technique

h = 663*^-36;
c = 3*^8;
k = 138*^-25;
l[λ_] := 
  Function[y, (2*h c^2/λ^5)/(Exp[h c/(λ k y)] - 1)];
a = Range[400, 700, 10]*10^-9;
v = Rationalize[{0.0004, 0.0012, 0.0040, 0.0116, 0.0230, 0.0380, 0.0600, 
    0.0910, 0.1390, 0.2080, 0.3230, 0.5030, 0.7100, 0.8620, 0.9540, 0.9950, 
    0.9950, 0.9520, 0.8700, 0.7570, 0.6310, 0.5030, 0.3810, 0.2650, 0.1750, 
    0.1070, 0.0610, 0.0320, 0.0170, 0.0082, 0.0041}];

I assume that you want l mapped onto a

lx = l /@ a;

lt = #[t] & /@ lx;

de = lt.v; 

See Dot product

Plot[{Evaluate[de], 1/683*10^5},
 {t, 745, 750},
 PlotLegends -> {"de", 1/683*10^5}]

enter image description here

soln = FindRoot[de == 1/683*10^5, {t, 748}, WorkingPrecision -> 30]

(*  {t -> 747.811927549212867608509450996}  *)

de == 1/683*10^5 /. soln

(*  True  *)
$\endgroup$
1
  • $\begingroup$ Yeah, very helpful, kind of more clear to find the suitable interval for the FindRoot Command $\endgroup$
    – Andrew
    Commented Oct 13, 2015 at 2:44

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.