When the previous code is executed, Mathematica can’t determine the unit of Lambda. Using the Quantity-command to assign a unit to Lambda will also assign a value to it, hence, it stops being a variable. I’d appreciate it, if somebody would suggest a useful method to solve this problem. thanks
seems to be an impossible requirement as you have defined
\[Alpha]t = Quantity[32.2 10^-2, ("Meters")^-1]
a bit earlier. So both the magnitude and the units do not match. Remember that 0 has no unit in your equation!, i.e. 0 is not the same as Quantity[0,“Meters”^-1].
The units must be consistent in your equations or Mathematica runs in to trouble.
Thanks for your reply. Actually, I was trying to find the intersection points of a curve and a line through NSolve. Obviously, I made a mistake that made Mathematica completely deaf. So you are right, the corrected version of the example is the following:
However, I still wonder whether, it is possible to assign a unit to a variable without giving it a value. For example, when you run the following code:
Mathematica shows the unit of the function in m/s. That’s, of course, because Mathematica doesn’t know the unit of Lambda. But, if it was possible to assign Lambda a Unit in Meters, then the unit of the function (f[Lambda]) will be correct, i.e in hertz. Also the function can stay symbolic for future applications. So do you think that such a thing is possible in Mathematica.