Add comment

This commit is contained in:
linarphy 2024-05-22 16:56:04 +02:00
parent 0587b5fbe3
commit 719cd3050e
No known key found for this signature in database
GPG key ID: E61920135EFF2295
2 changed files with 19 additions and 13 deletions

View file

@ -131,19 +131,25 @@ class Analyzer:
Compute psd of the computed projection with current bench Compute psd of the computed projection with current bench
excitation excitation
""" """
result = zeros( results = zeros(
(
len(self.coupling),
len( len(
interpolate_abciss( interpolate_abciss(
(self.movement.psd(), self.coupling[0].abs()) (self.movement.psd(), self.coupling[0].abs())
) )
),
) )
) )
# frequencies depends of psd result, which we do not have yet # frequencies depends of psd result, which we do not have yet
frequencies = zeros(len(result)) frequencies = zeros(results.shape[1])
for index in range(len(self.coupling)): for index in range(len(self.coupling)):
phase = (index + 1) * 4 * pi / (self.settings.wavelength*1e6) phase = (
(index + 1) * 4 * pi / (self.settings.wavelength * 1e6)
# * 1e6 sinon la courbe n'est plus du tout la même
)
factor_n = (self.movement * phase).sin().psd().sqrt() factor_n = (self.movement * phase).sin().psd().sqrt()
coupling_n = self.coupling[0].abs() coupling_n = self.coupling[0].abs()
@ -157,14 +163,15 @@ class Analyzer:
# no need to redefine it each time but simpler here # no need to redefine it each time but simpler here
frequencies = factor_n.x frequencies = factor_n.x
result += ( """ # from theoric equation
results[index] = (
sqrt(self.settings.scattering_factor[index]) sqrt(self.settings.scattering_factor[index])
* self.settings.power_in * self.settings.power_in
/ self.settings.power_out / self.settings.power_out
* (coupling_n * factor_n + coupling_d * factor_d).y * (coupling_n * factor_n + coupling_d * factor_d).y
) )
""" """
result += ( results[index] = ( # from matlab
sqrt(self.settings.scattering_factor[index]) sqrt(self.settings.scattering_factor[index])
* self.settings.wavelength * self.settings.wavelength
/ (4 * pi) / (4 * pi)
@ -172,11 +179,10 @@ class Analyzer:
.sqrt() .sqrt()
.y .y
) ** 2 ) ** 2
"""
self.projection = Signal( self.projection = Signal(
frequencies, frequencies,
result, sum(results),
self.settings, self.settings,
) )
return self.projection return self.projection.sqrt()

View file

@ -34,7 +34,7 @@ class Settings:
self.calib_bench = 1.15 self.calib_bench = 1.15
self.calib_mirror = 1.15 self.calib_mirror = 1.15
self.scattering_factor = [1.3e-3, 1e-12] # parameter to change self.scattering_factor = [1.3e-4, 1e-16] # parameter to change
self.vibration_frequency = 0.2 self.vibration_frequency = 0.2
index = 0 index = 0