Comments (14)
Thanks @simbilod. I got it to work after updating the interpreter in Jupyter notebooks to python 3.11.
from femwell.
Hi @timothyara ,
I was able to get your geometry to work. I made a PR on your repo.
Couple things:
- You don't need to scale your dimensions and wavelength, you can use the numbers as they are and choose appropriate characteristic_lengths and resolutions
- I quickly found modes confined to the silica cladding with low resolution, meaning it works -- but to make sure the result is physical, you should increase the resolution until the result stabilizes. Higher resolution will mean longer computation times and memory errors if you go too high for your machine. ***
- (Bonus) For circular geometries, we can actually do slightly better than polygons by directly using GMSH disks
*** Note that here this might be tricky. Since your wavelength is so small and your guiding structure so large, there are a large number of modes with an effective index almost exactly equal to the cladding index. So we cannot just use the effective index as a measure of convergence, and the eigensolver may or may not reliably return the eigenvectors in the same order as we change the matrix (number of nodes in the geometry).
from femwell.
Hey Timothy,
it seems to me that you'd just need to adjust the geometry in https://helgegehring.github.io/femwell/photonics/examples/waveguide_modes.html
you can define circles using
shapely.Point(0,0).buffer(1, resolution=6)
where you can adjust resultuion to have more/less points.
Would you have a paper we could reproduce in the docs?
from femwell.
I'm sorry but I'm not sure I understand what you mean by 'paper'. Could you please clarify.
from femwell.
Some peer-reviewed publication in a journal which deals with a structure similar to the one you want to simulate.
from femwell.
No, that's the issue. I can't find any scientific papers that use this precise fiber. I have included the data sheet for the glass tube. I am hoping that by modeling this in python I can learn the launch conditions of a He-Ne laser beam into the capillary in order to obtain a gaussian like mode.
from femwell.
I didn't mean the exact fiber, but just a similar one as a starting point. https://doi.org/10.3390/s20041191 seems for example to be something similar like you're working on? Easiest is usually to start by reproducing something (even through it's a different geometry) and then adjust the numbers to your case.
I'd guess if you create three circles, the inner one, the outer one and an even larger one (to represent the air around the fiber) the geometry should be set up.
You'll need to set the characteristic_lengthscale/resolutions larger for the meshing to not overshoot with elements (should be fine as the solution should vary quite slowly)
Maybe just start and if you run into problems you can post your code here? :)
from femwell.
Thanks! I will work on it and let you know if I have questions.
from femwell.
Here is a link to my code: https://github.com/timothyara/test_repo/blob/2c3fd3c20a49d231d4952b67a886c244abf3560b/Capillary_Fiber_calc.ipynb
I wasn't able to get the solution for the modes and I'm not sure why. When I ran compute_modes the computer was taking a really long and at some point I just interrupted the kernel. I made the buffer radius = 2 which represents the physical radius of the fiber of 350 microns. I then used this scaling and determined the wavelength to be .003617 for 633 nm. Not sure if this is the correct way of going about it so clarification on this would be nice. I appreciate your help.
from femwell.
Thank you @simbilod
I ran the updated code after doing a 'pip install meshwell' to try to replicate your results but I'm getting thrown the following Type error in the Prism class:
File ~/opt/anaconda3/lib/python3.8/site-packages/meshwell/prism.py:24, in Prism()
22 model: Any
23 physical_name: Optional[str] = Field(None)
---> 24 mesh_order: float | None = None
25 mesh_bool: bool = Field(True)
26 buffered_polygons: List[Tuple[float, Polygon]] = []
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
I didn't change anything with the code so I'm not sure why this is happening.
from femwell.
Can anyone help me understand why I'm receiving the Type error in the Prism class. I'm just trying to produce the same results as @simbilod but this error is preventing me from doing so. Here is the link to the code in my repository that displays the error: https://github.com/timothyara/test_repo/blob/710035f82d68d62b73d59cf3af9361f47f11764a/Capillary_Fiber_calc_updated.ipynb
from femwell.
what is your pydantic version? When you run pip show pydantic
from femwell.
Ah nevermind this seems like it's a python version error. Can you use Python 3.10+?
from femwell.
Great! Closing for now, feel free to reach out again if anything else comes up :)
from femwell.
Related Issues (20)
- Calculation of effective mode area or nonlinear coefficent HOT 13
- efficient wide sweeps for waveguide dispersion HOT 2
- mode solver neff jumps HOT 6
- treating quasi-TE mode in overlap with the mode of an optical fiber HOT 1
- incorrect neff in long wavelength HOT 10
- Calculation of effective area for Spontaneous Four-wave Mixing (SFWM) HOT 3
- Possible issue with modes / overlap integrals in complex systems HOT 1
- Example to reproduce
- Add symmetry planes for simulation to filter TE and TM for optics, or even and odd modes for RF HOT 3
- mesh_from_Dict does not handle MultiLineStrings() HOT 4
- Giving an initial solution to the solver (thermal and electrostatic sims) HOT 1
- Anisotropic materials HOT 11
- Bibliography file is a bit messy
- References in docs can contain both URL and doi HOT 2
- Maximum number of iterations taken when calling eigen solver from Arpack HOT 2
- plotting Waveguide mode components HOT 2
- Windows installation of femwell HOT 3
- How to Install the Julia version of femwell HOT 6
- Adjust propagation loss example to paper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from femwell.