Obtaining voltage ripple in simulink
2 Comments
Answers (5)
1 vote
0 votes
0 votes
% MATLAB Code: Ripple Content Calculation
clc; clear; close all;
% ----- Example Output Voltage Waveform ----- % Simulate a rectified (pulsating DC) signal t = 0:0.001:0.1; % Time (s) Vdc = 12; % Average DC voltage (Volts) Vr = 2 * sin(2*pi*100*t); % Ripple voltage (AC component, 100 Hz) Vout = Vdc + Vr; % Total output voltage
% ----- Calculate Ripple ----- Vdc_measured = mean(Vout); % DC component Vr_ac = Vout - Vdc_measured; % Remove DC part Vr_rms = rms(Vr_ac); % RMS value of AC component ripple_percent = (Vr_rms / Vdc_measured) * 100; % Ripple content %
% ----- Display Results ----- fprintf('Measured DC Voltage: %.3f V\n', Vdc_measured); fprintf('Ripple RMS (AC part): %.3f V\n', Vr_rms); fprintf('Ripple Content: %.2f %%\n', ripple_percent);
% ----- Plot ----- figure; plot(t, Vout, 'LineWidth', 1.5); xlabel('Time (s)'); ylabel('Output Voltage (V)'); title('Output Voltage with Ripple'); grid on;
0 votes
Measured DC Voltage: 12.00 V Ripple RMS (AC part): 1.00 V Ripple Content: 8.33 %
0 votes
Categories
Find more on Power Converters in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!