These are chat archives for sympy/sympy/optics
First of all, kudos to you for your initiative on implementing the optics module. I am actually very new to SymPy. When I saw the "Optics" module in SymPy I immediately wanted to see what's there, as I happen to work a little bit with optics and imaging. While I was looking at the code, some questions/ thoughts came up, and I thought that I should probably let you know. Please note that I don't mean to intrude here in any way. So if you think my questions are relevant, and you have some time, please consider responding, else it is just fine.
Is there any particular reason why you chose to implement a transverse wave class in the optics module? I mean, optical waves are just one example of transverse wave model. For example the displacement in a taut
string can be represented using the same model. And there are many other examples too. My point is that a general "wave class" could be written that is a super-class of all the different cases. This will probably prevent code duplication if in future someone wants to model the propagation of wave in a stretched string in the physics module. Also, you may probably consider renaming the (sub-class) as OpticalWave ... just a thought!
As I understand, you are in favor of this one yourself. I strongly agree that the "gaussoptics" module should be moved inside the optics module. Since you are actively working on the optics module this is probably the right time to do it ... of course if other people are in agreement. Good work!
Thanks for the nice feedback! Regarding the first point, initially I thought of creating a wave class but the question was where it should stay. IMO optics module was not a right place for that. One more thing.. if I would have created that class, I should have also considered the case of longitudinal wave. Your proposition will indeed reduce the code duplication and I think we should consider it. @flacjacket This is necessary because once we create a public API it'll become difficult to make further changes.
You may want to take a look at my proposal for optics. Your comments are most welcome.
For the second point I'll create a pull request to move it.
@debugger22 "initially I thought of creating a wave class but the question was where it should stay. IMO optics module was not a right place for that."
Good to know that we are on the same page. I think a "wave" module should be in physics at the same level that others like "sho.py" are placed.
"if I would have created that class, I should have also considered the case of longitudinal wave."
"This is necessary because once we create a public API it'll become difficult to make further changes."
I am glad that you mentioned it. I had the exact same concern in my mind. I think once the blue print is in place, you (or someone else) can extend the work you are doing now. For example, allowing the wave equation to be defined in 3 spatial dimensions plus time, etc.
I have read your proposal in parts, I will read it more thoroughly in the coming days.