Skip to content

Commit b8b26e2

Browse files
committed
Site updated: 2021-10-08 08:17:31
1 parent 63fdc4a commit b8b26e2

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

2021/10/05/激光原理课程设计-自再现模的迭代法-的代码/index.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,4 @@
129129
</code></pre>
130130
<p>结果大概长这样~</p>
131131
<p><img src="https://i.loli.net/2021/10/05/4mP3CAgilEQ9b2y.jpg" alt="结果.jpg"></p>
132-
<p>$$
133-
\begin{align*}
134-
y = y(x,t) &amp;= A e^{i\theta} \
135-
&amp;= A (\cos \theta + i \sin \theta) \
136-
&amp;= A (\cos(kx - \omega t) + i \sin(kx - \omega t)) \
137-
&amp;= A\cos(kx - \omega t) + i A\sin(kx - \omega t) \
138-
&amp;= A\cos \Big(\frac{2\pi}{\lambda}x - \frac{2\pi v}{\lambda} t \Big) + i A\sin \Big(\frac{2\pi}{\lambda}x - \frac{2\pi v}{\lambda} t \Big) \
139-
&amp;= A\cos \frac{2\pi}{\lambda} (x - v t) + i A\sin \frac{2\pi}{\lambda} (x - v t)
140-
\end{align*}
141-
$$</p>
142132
</article><section class="jump-container is-flex is-justify-content-space-between my-6"><!-- em is empty placeholder--><em></em><a class="button is-default" href="/2021/10/04/hello-world/" title="Hello World"><span class="has-text-weight-semibold">下一页: Hello World</span><i class="iconfont icon-next ml-2 has-text-grey"></i></a></section></div></div></main></main><footer class="is-flex is-flex-direction-column is-align-items-center is-flex-shrink-0 is-family-serif"><section class="sns-container"><!-- Github--><a title="github" target="_blank" rel="noopener nofollow" href="//github.com/wjsvec"><i class="iconfont icon-github"></i></a><!-- Ins--><!-- RSS--><!-- 知乎--><!-- 领英--><!-- 脸书--></section><p><span>Copyright ©</span><span> Wjsvec 2021</span></p><div class="is-flex is-justify-content-center is-flex-wrap-wrap"><p>Powered by Hexo &verbar;&nbsp;</p><p class="is-flex is-justify-content-center"><a title="Hexo theme author" target="_blank" rel="noopener" href="//github.com/haojen">Theme by Haojen&nbsp;</a></p><div style="margin-top: 2px"><a class="github-button" title="github-button" target="_blank" rel="noopener" href="https://github.com/haojen/hexo-theme-Claudia" data-color-scheme="no-preference: light; light: light; dark: dark;" data-show-count="true"></a></div></div><div><span></span></div></footer><script async defer src="https://buttons.github.io/buttons.js"></script><script src="/js/post.js"></script></body></html>

search.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<link href="/2021/10/05/%E6%BF%80%E5%85%89%E5%8E%9F%E7%90%86%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1-%E8%87%AA%E5%86%8D%E7%8E%B0%E6%A8%A1%E7%9A%84%E8%BF%AD%E4%BB%A3%E6%B3%95-%E7%9A%84%E4%BB%A3%E7%A0%81/"/>
99
<url>/2021/10/05/%E6%BF%80%E5%85%89%E5%8E%9F%E7%90%86%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1-%E8%87%AA%E5%86%8D%E7%8E%B0%E6%A8%A1%E7%9A%84%E8%BF%AD%E4%BB%A3%E6%B3%95-%E7%9A%84%E4%BB%A3%E7%A0%81/</url>
1010

11-
<content type="html"><![CDATA[<h1>自再现模的迭代法的Matlab代码</h1><p>垂雷大学激光工程的作业,网上找了一下<a href="https://wenku.baidu.com/view/994ceae9f8c75fbfc77db25d.html">百度文库有篇相关的文章</a>,不过里面的代码写的不太规范(命名啊,空格啊),就按照自己的习惯改了改,再说百度文库也不好复制粘贴,就放在这里吧。万一有人用得着呢?</p><p>(一个课程的同学别抄啊)</p><pre><code>% 注:QU渡越函数在提交的同一目录下,缺少这个函数无法运行clearclcglobal steps cavity_length waveloss mirror_long wavalength% 定义各种参数的初始值wavalength = 0.0000006328; %波长cavity_length = 0.00006328; %腔长mirror_long = 0.00001582; %镜长N = 300; %渡越次数waveloss = 2*pi/wavalength; %波失steps = 500; %步长% 声明变量的空间x = linspace(-mirror_long, mirror_long, steps);uN = ones(1,steps);u1 = ones(1,steps);u_n = ones(1,steps);% 经过1次渡越for i = 1:steps u1(i) = QU(x(i),u_n);endu_n1 = u1/max(abs(u1));% 经过N次渡越for i = 1:Nfor j = 1:stepsuN(j) = QU(x(j),u_n);endu_n= uN/max(abs(uN));end% 做图,振幅subplot(2,1,1)grid onplot(x,abs(uN)/abs(uN(steps/2)), 'b--')hold onplot(x,abs(u1)/abs(u1(steps/2)),'r')title('振幅');xlabel('振幅分布');ylabel('相对振幅');angle_uN=angle(uN)/pi*180;angle_u1=angle(u1)/pi*180;angle_uN=angle_uN-angle_uN(steps/2);angle_u1=angle_u1-angle_u1(steps/2);%做图,相位subplot(2,1,2)grid onplot(x,angle_uN, 'b--')hold onplot(x,angle_u1, 'r')title('相位');xlabel('相位分布');ylabel('相对相位');</code></pre><p>QU 函数的代码(文件名为QU.m ,跟上面的代码放在一起就好)</p><pre><code>function y=QU(x,u)global steps cavity_length waveloss mirror_long wavalengthx_=linspace(-mirror_long,mirror_long,steps);step_length=2*mirror_long/(steps-1);y=sqrt(1i/cavity_length/wavalength*exp(-1i*waveloss*cavity_length))*sum(exp(-1i*waveloss/2/cavity_length*(-x_+x).^2).*u)*step_length;</code></pre><pre><code> ```yml _config.yml highlight: enable: true line_number: true auto_detect: false tab_replace: markdown: render: html: true xhtmlOut: false breaks: false linkify: true typographer: true quotes: '“”‘’' plugins: - markdown-it-abbr - markdown-it-footnote - markdown-it-ins - markdown-it-sub - markdown-it-sup - markdown-it-deflist anchors: level: 1 collisionSuffix: 'v' permalink: false permalinkClass: header-anchor permalinkSymbol: &quot;&quot; permalinkBefore: false date_format: ll archive_generator: per_page: 0 yearly: true monthly: false daily: false theme: cutie ```</code></pre><p>结果大概长这样~</p><p><img src="https://i.loli.net/2021/10/05/4mP3CAgilEQ9b2y.jpg" alt="结果.jpg"></p><p>$$\begin{align*}y = y(x,t) &amp;= A e^{i\theta} \&amp;= A (\cos \theta + i \sin \theta) \&amp;= A (\cos(kx - \omega t) + i \sin(kx - \omega t)) \&amp;= A\cos(kx - \omega t) + i A\sin(kx - \omega t) \&amp;= A\cos \Big(\frac{2\pi}{\lambda}x - \frac{2\pi v}{\lambda} t \Big) + i A\sin \Big(\frac{2\pi}{\lambda}x - \frac{2\pi v}{\lambda} t \Big) \&amp;= A\cos \frac{2\pi}{\lambda} (x - v t) + i A\sin \frac{2\pi}{\lambda} (x - v t)\end{align*}$$</p>]]></content>
11+
<content type="html"><![CDATA[<h1>自再现模的迭代法的Matlab代码</h1><p>垂雷大学激光工程的作业,网上找了一下<a href="https://wenku.baidu.com/view/994ceae9f8c75fbfc77db25d.html">百度文库有篇相关的文章</a>,不过里面的代码写的不太规范(命名啊,空格啊),就按照自己的习惯改了改,再说百度文库也不好复制粘贴,就放在这里吧。万一有人用得着呢?</p><p>(一个课程的同学别抄啊)</p><pre><code>% 注:QU渡越函数在提交的同一目录下,缺少这个函数无法运行clearclcglobal steps cavity_length waveloss mirror_long wavalength% 定义各种参数的初始值wavalength = 0.0000006328; %波长cavity_length = 0.00006328; %腔长mirror_long = 0.00001582; %镜长N = 300; %渡越次数waveloss = 2*pi/wavalength; %波失steps = 500; %步长% 声明变量的空间x = linspace(-mirror_long, mirror_long, steps);uN = ones(1,steps);u1 = ones(1,steps);u_n = ones(1,steps);% 经过1次渡越for i = 1:steps u1(i) = QU(x(i),u_n);endu_n1 = u1/max(abs(u1));% 经过N次渡越for i = 1:Nfor j = 1:stepsuN(j) = QU(x(j),u_n);endu_n= uN/max(abs(uN));end% 做图,振幅subplot(2,1,1)grid onplot(x,abs(uN)/abs(uN(steps/2)), 'b--')hold onplot(x,abs(u1)/abs(u1(steps/2)),'r')title('振幅');xlabel('振幅分布');ylabel('相对振幅');angle_uN=angle(uN)/pi*180;angle_u1=angle(u1)/pi*180;angle_uN=angle_uN-angle_uN(steps/2);angle_u1=angle_u1-angle_u1(steps/2);%做图,相位subplot(2,1,2)grid onplot(x,angle_uN, 'b--')hold onplot(x,angle_u1, 'r')title('相位');xlabel('相位分布');ylabel('相对相位');</code></pre><p>QU 函数的代码(文件名为QU.m ,跟上面的代码放在一起就好)</p><pre><code>function y=QU(x,u)global steps cavity_length waveloss mirror_long wavalengthx_=linspace(-mirror_long,mirror_long,steps);step_length=2*mirror_long/(steps-1);y=sqrt(1i/cavity_length/wavalength*exp(-1i*waveloss*cavity_length))*sum(exp(-1i*waveloss/2/cavity_length*(-x_+x).^2).*u)*step_length;</code></pre><pre><code> ```yml _config.yml highlight: enable: true line_number: true auto_detect: false tab_replace: markdown: render: html: true xhtmlOut: false breaks: false linkify: true typographer: true quotes: '“”‘’' plugins: - markdown-it-abbr - markdown-it-footnote - markdown-it-ins - markdown-it-sub - markdown-it-sup - markdown-it-deflist anchors: level: 1 collisionSuffix: 'v' permalink: false permalinkClass: header-anchor permalinkSymbol: &quot;&quot; permalinkBefore: false date_format: ll archive_generator: per_page: 0 yearly: true monthly: false daily: false theme: cutie ```</code></pre><p>结果大概长这样~</p><p><img src="https://i.loli.net/2021/10/05/4mP3CAgilEQ9b2y.jpg" alt="结果.jpg"></p>]]></content>
1212

1313

1414

0 commit comments

Comments
 (0)