sinus wave with chosen number of variating period

1 次查看(过去 30 天)
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 个评论
Mathieu NOE
Mathieu NOE 2025-7-17
hello
can you share the code and maybe the paper or doc you are refering to
Hugo
Hugo 2025-7-17
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.

请先登录,再进行评论。

采纳的回答

Hugo
Hugo 2025-7-17
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by