Setting the parameters II

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting the parameters II

Mehdi_Kazemi
How to properly set the Nx, Ny, Nz, Nt and the respective step size and time windows?
What is the relation between those parameters, crystal (material) length, pulse duration and propagation time of the pulse through the crystal?
Reply | Threaded
Open this post in threaded view
|

Re: Setting the parameters II

tinolang
Administrator
There are several options which can lead you to the best sampling parameter.

1)
To understand what is going on you can calculated it by hand. Usually you know the necessary temporal window and the spectral with to include all input pulses and mixing products. The temporal window and the spectral window are connected as following:

max sampling frequency = 1/dt
whereas the min sampling frequency is 1/temporal window which is in the THz spectral range. This frequency window can be shifted by obj.simProp.shiftFreqWindow to save computation time. This leads to the following relation:
dt=1/(3e8/lambdaMin-3e8/lambdaMax)

Nt is then your temporal window divided by dt

The Nx and Ny depends on the spatial window and the maximum nonlinear propagation you want to sample

fxMax=sin(alphaMax)*n/lambdaMax;
dx=1/fxMax;
Nx=spaceMax/dx;

As an alternive you can use two methods of chi3D which can do the job for you:
obj=chi3d;
obj.minNtime.help
obj.minNspace.help

2) You can also play around with chi2D and check out which sampling gives you reasonable results.
 
The results should not depend on the sampling. This is also true for Nz. Increase Nz till the output parameter are not depending on it anymore.



Tino Lang
Reply | Threaded
Open this post in threaded view
|

Re: Setting the parameters II

susannexoxo
In reply to this post by Mehdi_Kazemi
To properly set the parameters Nx, Ny, Nz, and Nt (number of spatial and temporal points), along with their respective step sizes (dx, dy, dz, dt), you need to consider the physical dimensions of your simulation domain and the resolution needed to accurately model wave propagation:

- **Nx, Ny, Nz**: Number of spatial steps in the x, y, z directions respectively. The product of step size and number of steps should cover the crystal length in each direction: `Nx × dx = Lx`, where `Lx` is the length in x-direction, and similarly for y and z.
- **Nt**: Number of time steps. The total time window should cover the full duration of pulse propagation: `Nt × dt ≥ T`, where `T` is the time the pulse needs to cross the crystal.

### Relations:
- **Pulse duration (τ)**: Affects the required temporal resolution `dt`. A shorter pulse needs a smaller `dt` to resolve features.
- **Crystal length (L)**: Determines spatial domain size, and thus influences `Nz` (or Nx/Ny for transverse directions).
- **Propagation time**: Depends on the refractive index `n` and speed of light `c`: `T_prop = L / (c/n)`. Make sure `Nt × dt ≥ T_prop`.

Also, ensure:
- `dz` and `dt` satisfy the **Courant condition** (if solving wave equations explicitly): `dt ≤ dz / v`, where `v = c/n`.

Pour bien modéliser une telle interaction physique, il faut autant de précision dans les détails que dans la coupe d’une robe sur mesure : chaque paramètre influence l’ensemble du résultat.
Reply | Threaded
Open this post in threaded view
|

Re: Setting the parameters II

tinolang
Administrator
Thanks susannexoxo
Tino Lang