Untitled Note
By: Anonymous4/6/2025137 views Public Note
1). SWITCH :-
f = 1e9;
lambda = 3e8 / f;
power_in = 1;
Z0 = 50;
attenuation_off = 3;
attenuation_on = 0;
switch_state = 0;
reflection_coefficient = 0.1;
reflection_loss = 20 * log10(abs(reflection_coefficient));
if switch_state == 0
path_loss = attenuation_off reflection_loss;
power_out = power_in * 10^(-path_loss/10);
fprintf('Switch OFF: Power Output = %.4f W\n', power_out);
else
path_loss = attenuation_on reflection_loss;
power_out = power_in * 10^(-path_loss/10);
fprintf('Switch ON: Power Output = %.4f W\n', power_out);
end
frequencies = linspace(0.5e9, 1.5e9, 100);
power_out_f = zeros(size(frequencies));
for i = 1:length(frequencies)
lambda_i = 3e8 / frequencies(i);
if switch_state == 0
path_loss_f = attenuation_off reflection_loss;
else
path_loss_f = attenuation_on reflection_loss;
end
power_out_f(i) = power_in * 10^(-path_loss_f / 10);
end
figure;
plot(frequencies / 1e9, power_out_f, 'LineWidth', 2);
title('Power Output vs Frequency');
xlabel('Frequency (GHz)');
ylabel('Power Output (W)');
grid on;
SCOKTY :-
I_s = 1e-12;
n = 1.1;
V_t = 26e-3;
V_min = -0.5;
V_max = 0.5;
V_step = 0.01;
V = V_min:V_step:V_max;
I = I_s * (exp(V / (n * V_t)) - 1);
figure;
plot(V, I, 'LineWidth', 2);
xlabel('Voltage (V)');
ylabel('Current (A)');
title('Schottky Diode I-V Characteristics');
grid on;
xlim([V_min, V_max]);
ylim([0, max(I)]);
2). CAPACITOR :-
% Microstrip Capacitor Calculation with Waveform
% Given Parameters
epsilon_r = 4.4; % Relative permittivity (dielectric constant of the substrate)
h = 1.6e-3; % Height of the substrate in meters (e.g., 1.6 mm)
W = 10e-3; % Width of the microstrip capacitor in meters (e.g., 10 mm)
% Constants
epsilon_0 = 8.854e-12; % Permittivity of free space in F/m
% Capacitance Calculation using the formula C = (epsilon_0 * epsilon_r * W) / h
C = (epsilon_0 * epsilon_r * W) / h;
% Display the capacitance
disp(['The capacitance of the microstrip capacitor is ', num2str(C * 1e12), ' pF']);
% --- Plotting Waveforms ---
% Time Vector for Simulation (0 to 1 microsecond)
t = linspace(0, 1e-6, 1000);
% Voltage waveform across the capacitor (assuming a sinusoidal voltage source)
V = 1 * sin(2 * pi * 1e6 * t); % 1 MHz frequency, amplitude of 1V
% Current through the capacitor (I = C * dV/dt)
% Use the difference to approximate the derivative of voltage
dV = diff(V); % Calculate the difference in voltage values
dt = diff(t); % Calculate the difference in time values
I = C * dV ./ dt; % Current is C * dV/dt (element-wise division)
% Adjust time vector to match the length of I
t_current = t(2:end); % Time for the current calculation (one less point)
% Plot Voltage vs Time
subplot(2,1,1);
plot(t, V, 'b-', 'LineWidth', 1.5);
title('Voltage across Microstrip Capacitor');
xlabel('Time (s)');
ylabel('Voltage (V)');
grid on;
% Plot Current vs Time
subplot(2,1,2);
plot(t_current, I, 'r-', 'LineWidth', 1.5);
title('Current through Microstrip Capacitor');
xlabel('Time (s)');
ylabel('Current (A)');
grid on;