% MZM bias sweep (physical coefficients) + field & power transfer functions % Uses your notation: % Pout/Pin = cos^2( (pi/2)*(v/Vpi) ), v = Vbias + Δv % Taylor around Vbias: % Pout/Pin ≈ a0 + a1 Δv + a2 Δv^2 + a3 Δv^3 % % Coefficients (physical units): % a0 [-], a1 [1/V], a2 [1/V^2], a3 [1/V^3] % % Also plots: % Field TF amplitude: Eout/Ein = cos( (pi/2)*(Vbias/Vpi) ) % Power TF: Pout/Pin = cos^2( (pi/2)*(Vbias/Vpi) ) clear; close all; clc; set(groot,'defaultLegendInterpreter','tex'); set(groot,'defaultAxesTickLabelInterpreter','tex'); set(groot,'defaultTextInterpreter','tex'); %% Parameters Vpi = 3; % [V] device half-wave voltage xb = linspace(0, 2, 2001); % x_b = Vbias/Vpi Vbias = xb * Vpi; % [V] %% Static transfer functions (at Vbias) H_field = cos((pi/2)*xb); % field amplitude TF (balanced MZM) T_power = H_field.^2; % intensity TF %% Taylor coefficients (physical units) a0 = T_power; a1 = -(pi/(2*Vpi)) .* sin(pi*xb); % [1/V] a2 = -(pi^2/(4*Vpi^2)) .* cos(pi*xb); % [1/V^2] a3 = +(pi^3/(12*Vpi^3)) .* sin(pi*xb); % [1/V^3] A0 = a0; A1 = a1 * Vpi; A2 = a2 * Vpi^2; A3 = a3 * Vpi^3; %% Plot figure('Color','w'); clf; % --- (1) Field + power TF vs bias --- hold on; grid on; plot(xb, H_field, 'LineWidth', 1.4, 'DisplayName','Field','Color','black','LineStyle','--'); % plot(xb, T_power, 'LineWidth', 1.4, 'DisplayName','Intensity','Color','black','LineStyle','-'); % --- (2) Physical Taylor coefficients vs bias --- % nexttile; hold on; grid on; plot(xb, a0, 'LineWidth', 1.4, 'DisplayName','Intensity','Color','black','LineStyle','-'); plot(xb, a1, 'LineWidth', 1.4, 'DisplayName','Linear'); plot(xb, a2, 'LineWidth', 1.4, 'DisplayName','Even'); plot(xb, a3, 'LineWidth', 1.4, 'DisplayName','Odd'); xlabel('$V/V_\pi$','Interpreter','latex'); ylabel('Transfer'); title('Static transfer functions vs bias'); xlim([min(xb) max(xb)]); ylim([-1.05 1.05]); legend('Location','best'); % Optional: tighten y-limits to avoid a0 dominating the view % Comment out if you prefer auto-scaling. yl = ylim; ylim([min(yl(1), -max(abs([a1 a2 a3]))*1.1), max(yl(2), max(abs([a1 a2 a3]))*1.1)]); xticks([0:0.5:2]);