sinus wave with chosen number of variating period

1 visualización (últimos 30 días)
Hugo
Hugo el 17 de Jul. de 2025
Respondida: Hugo el 17 de Jul. de 2025
Hi,
I am trying to simulate a refractive index change in a medium, to do that I need to accurately model the evolution of said index with a sinusoidal function with variating period (see picture below for an exemple).
The function is written as n(z)=n0+n1*cos(phi(z)) (n being the index), with phi(z)=alpha/(z+beta), I would expect that fixing beta and calculating alpha for alpha=nT*2*pi*(zmax+beta) (with nT the number of period in the interval from z=0 to z=zmax) would give me a function with nT period but it does not, where did I go wrong?
Thanks
  2 comentarios
Mathieu NOE
Mathieu NOE el 17 de Jul. de 2025
hello
can you share the code and maybe the paper or doc you are refering to
Hugo
Hugo el 17 de Jul. de 2025
Hello, the code follows the equations :
%%for the figure shared
N=1e6 %increase N for better plot
z=linspace(0,5e-3,N);
n0=1.445;
n1=8e-4;
n=n0+n1*cos(100e-5./(z+1e-6));
%%when trying for a certain amount of periods
N=1000
nT=1000;
z=linspace(0,5e-3,N);
beta=1e-6;
alpha=nT*2*pi*(z(end)+beta);
n=n0+n1*cos(alpha./(z+beta));
I do not get what more I could explain about it, the article will not really be helpful when it comes to answering this question but here it is https://piers.org/pierspublications/PIERS2011SuzhouProceedings04.pdf page 158 of the pdf document, it is focused on the partition integration method for the numerical simulation not on the model of the function applied to z in the cosinus only mentionned once in fig 1.

Iniciar sesión para comentar.

Respuesta aceptada

Hugo
Hugo el 17 de Jul. de 2025
Ok not sure that is the best way to do it but it works for me :
define phi(z) as alpha*log(z) and dimension alpha the same way as before.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by