These are chat archives for sympy/sympy/optics

9th
Jun 2014
Sudhanshu Mishra
@debugger22
Jun 09 2014 17:53
@flacjacket is it ok to use epsilon_0 for permittivity of free space or should I import it from units?
from sympy.physics.units import e0
Same goes for magnetic permeability
Regarding this PR sympy/sympy#7580
Sean Vig
@flacjacket
Jun 09 2014 17:55
it is probably a good idea to use the units module
though i'm not sure how well developed it is, i remember seeing people talking about changing it
but it looks like it would be good for this
Sudhanshu Mishra
@debugger22
Jun 09 2014 17:56
ok
one more thing
Sean Vig
@flacjacket
Jun 09 2014 17:56
same goes for speed of light, which you currently have as a symbol
Sudhanshu Mishra
@debugger22
Jun 09 2014 17:57
I've imported it from units
Are u talking abt TWave?
Yeah there I have it as a Symbol
I'll change that
Could you please take a look at this constructor
Here, it will be easy to initialize medium with its refractive index
But then properties like permittivity and permeability couldn't be evaluated
separately
Should I just leave them not evaluated or is there any workaround?
Sean Vig
@flacjacket
Jun 09 2014 18:02
i think that would be the best, yeah
though permeability is almost always 1...
hmm
so if you have permeability and permitivity, it's ok
Sudhanshu Mishra
@debugger22
Jun 09 2014 18:03
But we can't return 1, right? :)
Sean Vig
@flacjacket
Jun 09 2014 18:03
index of refraction and either permeability or permitivity is ok
Sudhanshu Mishra
@debugger22
Jun 09 2014 18:04
IMHO, we should just raise an exception
Sean Vig
@flacjacket
Jun 09 2014 18:04
ah, right, haha, 1 being same as free space
Sudhanshu Mishra
@debugger22
Jun 09 2014 18:04
that it can't be evaluated
Sean Vig
@flacjacket
Jun 09 2014 18:05
yeah, if you just get one of the 3: index of refracion, permeability, permitivity, you can raise an exception
Sudhanshu Mishra
@debugger22
Jun 09 2014 18:06
i think letting them initialize with index of refraction is ok
but in that case they cant get permittivity or the other back
It may not sound good
But I feel that it's less headache for users :smile:
Sean Vig
@flacjacket
Jun 09 2014 18:08
yeah, that sounds good
Sudhanshu Mishra
@debugger22
Jun 09 2014 18:08
Thanks!
If you get time, please have a look on this PR sympy/sympy#7580
I'll write my blog post soon
Last week was not so productive though
Sorry for that
But I hope to pick up the pace soon
:smile: