0
$\begingroup$

Since this morning I have the following command to return Pi as a symbol in the value of k. Since k is then used as a parameter for a plot the Plot does not come out anymore... Can you tell me what I accidentally did and how can I solve this issue?

λ=6328 10^-9;
(*change this value to set new wavelength*)

k=(2 Pi)/λ
(* (250000000 π)/791 *)
$\endgroup$
  • 5
    $\begingroup$ Can you show an example of "Since k is then used as a parameter for a plot the Plot does not come out anymore" ? $\endgroup$ – Dr. belisarius Nov 19 '15 at 15:02
  • 2
    $\begingroup$ If you're merely feeding in k as part of the argument to a function for Plot, there is not particular reason to take a numerical value (i.e., an approximate value) of Pi or \[Lambda] or k. Mathematica will be using numerical values of the variable, and when any approximate number is combined algebraically with an exact value, the result will automatically be approximate. So please do show us exactly what the Plot expression is that is giving trouble. $\endgroup$ – murray Nov 19 '15 at 15:19
1
$\begingroup$

Define a numerical version of π

pi = N @ Pi
(* 3.14159 *)

λ = 6328 10^-9;
k = (2 pi)/λ 
(* 992918. *)
$\endgroup$
  • 2
    $\begingroup$ I'd argue the proper thing here is to simply make lambda real just by adding a decimal, since it surely is a real/inexact number anyway. $\endgroup$ – george2079 Nov 19 '15 at 17:04

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