- 欧几里德定理:如果d是a和b的公约数,那么d也是b 和 a和b余数 的公约数
Fortan 90
program euclidean_algorithm
implicit none
integer, allocatable :: numbers(:)
integer :: num_elements
integer :: remainder, a, b
write(*, *) "Please enter two integers (separated by spaces):"
read(*, *) a, b
num_elements = 2
allocate(numbers(num_elements))
numbers(1) = a
numbers(2) = b
remainder = mod(numbers(1), numbers(2))
do while (remainder /= 0)
numbers(1) = numbers(2)
numbers(2) = remainder
remainder = mod(numbers(1), numbers(2))
end do
write(*, *) "The maximum common divisor is:", numbers(2)
deallocate(numbers)
read(*,*)
end program euclidean_algorithm
实例一
- 给定互质的n1 与 n2,求出 t1 与 t2 使得满足 t1 * n1 + t2 * n2 = 1
matlab 实现
clear all;
clc;
n1 = 72317;
n2 = 100007;
[t1,t2] = Euclidean_alg(n1,n2);
disp "[t1,t2]:",[t1,t2]
function [t1,t2] = Euclidean_alg(n1,n2)
if n2 == 0
t1 = 1;
t2 = 0;
else
[t1,t2] = Euclidean_alg(n2,mod(n1,n2));
temp = t1;
t1 = t2;
t2 = temp - floor(n1/n2) * t2;
end
end
Fortran 90 实现
program calculate
implicit none
integer :: n1, n2, t1, t2
n1 = 717
n2 = 9074137
call Euclidean_alg(n1, n2, t1, t2)
print *, "[t1,t2]: ", t1, t2
read(*,*)
contains
RECURSIVE subroutine Euclidean_alg(n1, n2, t1, t2)
implicit none
integer, intent(in) :: n1, n2
integer, intent(out) :: t1, t2
integer :: temp
if (n2 == 0) then
t1 = 1
t2 = 0
else
call Euclidean_alg(n2, mod(n1, n2), t1, t2)
temp = t1
t1 = t2
t2 = temp - int(n1/n2) * t2
end if
end subroutine Euclidean_alg
end program calculate
water begin
基于二元光强调制的自适应光学技术研究
- 这种无波前AO系统不依赖传感器获取波前信息,而是利用调制后的光束强度信息建立波前像差模式系数和远场焦斑强度的函数关系,进而得到变形 镜驱动电压与重构波前的关系。若探测器可以选择单光子计数阵列,该系统将具备应用于激光通信中的巨大潜力。
Walsh函数
- Walsh函数是1923年数学家J.L.Walsh提出一种仅取-1和+1的正交函数系,Walsh函数可以用于波前拟合。
- Walsh函数在极坐标下可被表示为:
- 绿色部分表示填入了+1,蓝色部分表示填入了-1
- Walsh函数在极坐标下可被表示为:
波前重构原理
- 由波前像差理论,含有像差的光波在远场焦点处形成的光斑光强可表示为
其中 是一个正比于入射光强的常数,为入射光波的振幅。
用N阶Walsh函数表示的光场相位展开式为:
其中 是一个复数。由数学变换得
考虑到复函数的多值性,通过确认相位主值 由Walsh函数重构的光场相位可以表示为:
利用最小二乘法可以实现相位解缠绕,最终可以得到处理后的重构波前:
其中 是k阶Zernike模式在对应的Walsh函数所划分的扇形区域内的相位值,是扇形域内的单位值。
二元光强调制的自适应光学系统
系统建造时便已确定了Zernike 系数与变形镜电压的关系矩阵
因此,同2.2介绍的自适应光学系统一样,我们可以给出变形镜校正电压矩阵:同样的,我们可以通过设定特定的电压阈值来判断校正效果是否令人满意。[]
下面便是基于二元光强调制的自适应光学系统的算法流程图:
这是整个操控系统运行的的流程图:
自适应光学在大气激光通信系统中的应用调研报告英文摘要
Adaptive optics technology has been applied to many fields including astronomical observation, communication, military, biology, nuclear industry, etc. since it was proposed in 1953. With the popularization of artificial intelligence, adaptive optics technology has been further developed. The birth of optical simulation and scientific computing software makes the design of adaptive optics more flexible and simple. This paper introduces several frontier applications of adaptive optics, that is, the applications of adaptive optics in astronomical observation, biological imaging, and inertial confinement (ICF), and emphatically investigates the application principles and future prospects of adaptive optics in atmospheric laser communication systems.