How to cover the entire 100 milliseconds without ion excitation?

9 visualizaciones (últimos 30 días)
Surik Ahmed
Surik Ahmed el 30 de Oct. de 2023
Respondida: Akanksha el 13 de Jun. de 2025
When applying the Stored-waveform Inverse Fourier Transform (SWIFT) waveform into an ion trap within the notches, the ion motion is observed on the output plot. Initially, the motion is visible from 0 to 30 milliseconds without any excitation, but the subsequent 70 milliseconds do not appear on the plot. I aim to modify this portion of the code to visualize the entire 100 milliseconds without any excitation. How can I achieve this? Thanks.
%swift
swift_value=swift_amp*swift_total(swift_count)/2/r0;
if swift_count>30000&&swift_count<70000
swift_value=30000*swift_amp*swift_total(swift_count)/2/r0;
else
swift_value=swift_amp*swift_total(swift_count)/2/r0;
end
E_swift=swift_value;
Eac=E_swift;

Respuestas (1)

Akanksha
Akanksha el 13 de Jun. de 2025
The issue with your provided code seems to be related to how the excitation signal (swift_value) is being modified between 30 ms and 70 ms. Herein the code multiplies the excitation by 30,000, which is likely too large and may be causing numerical instability or suppressing the ion motion.
To visualize the full 100 ms without any excitation, you should remove or bypass the conditional block and set the excitation to zero.
Kindly go through the following updated code that I have tried enclosed with the output:
% Parameters
total_time_ms = 100; % Total simulation time in milliseconds
sampling_rate = 1e6; % 1 MHz sampling rate (1 µs per sample)
total_samples = total_time_ms * 1e3; % Total number of samples
% Ion trap parameters (example values)
r0 = 1; % Characteristic dimension of the trap
swift_amp = 1; % Amplitude of SWIFT waveform
swift_total = randn(1, total_samples); % Simulated SWIFT waveform (random noise)
% Initialize arrays
Eac = zeros(1, total_samples); % No excitation
ion_motion = zeros(1, total_samples); % Placeholder for ion motion
% Simulate ion motion (example: simple harmonic motion without excitation)
for swift_count = 1:total_samples
% No excitation applied
swift_value = 0;
E_swift = swift_value;
Eac(swift_count) = E_swift;
% Simulated ion motion (e.g., natural oscillation)
ion_motion(swift_count) = sin(2 * pi * 1000 * swift_count / sampling_rate); % 1 kHz natural frequency
end
% Time axis in milliseconds
time_ms = (0:total_samples - 1) / 1000;
% Downsample for smoother plotting (e.g., every 100th point)
downsample_factor = 100;
time_ds = time_ms(1:downsample_factor:end);
motion_ds = ion_motion(1:downsample_factor:end);
% Plot the ion motion
figure;
plot(time_ds, motion_ds, 'r');
xlabel('Time (ms)');
ylabel('Ion Motion (arb. units)');
title('Ion Motion Without Excitation (0–100 ms)');
grid on;
Hope this helps!

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by