sinus wave with chosen number of variating period

1 Ansicht (letzte 30 Tage)
Hugo
Hugo am 17 Jul. 2025
Beantwortet: Hugo am 17 Jul. 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 Kommentare
Mathieu NOE
Mathieu NOE am 17 Jul. 2025
hello
can you share the code and maybe the paper or doc you are refering to
Hugo
Hugo am 17 Jul. 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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Hugo
Hugo am 17 Jul. 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.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by