i need some help with my code simulating the pacific HVDC intertie, for some reason it won’t open in simulink

8 views (last 30 days)
clc; clear; close all;
% Model name
modelName = 'HVDC_Pacific_Intertie_Model';
new_system(modelName); % Create new model
open_system(modelName); % Open Simulink model
%% Parameters
Line_length = 1362; % km
Rdc = 0.02 * Line_length; % total resistance
Ldc = 0.001 * Line_length; % total inductance
Cdc = 2.5e-6 * Line_length;% total capacitance
%% Add Three-Phase Source (AC Grid - Rectifier Side)
add_block('powerlib/Elements/Three-Phase Source', [modelName '/AC_Source'], ...
'Position', [100 100 150 150]);
There is no block named 'powerlib/Elements/Three-Phase Source'
%% Add Transformer (Rectifier Side)
add_block('powerlib/Elements/Three-Phase Transformer (Two Windings)', ...
[modelName '/Transformer1'], ...
'Position', [200 100 250 150]);
%% Add Rectifier Bridge (Thyristor - 6-Pulse)
add_block('powerlib/Elements/Universal Bridge', ...
[modelName '/Rectifier'], ...
'PowerElectronicDevice', 'Thyristor', ...
'Position', [300 100 350 150]);
%% Add DC Smoothing Reactor
add_block('powerlib/Elements/Series RLC Branch', ...
[modelName '/DC_Smoothing'], ...
'BranchType', 'L', ...
'Inductance', '1', ...
'Position', [400 100 450 150]);
%% HVDC Transmission Line (RLC elements)
add_block('powerlib/Elements/Distributed Parameters Line', ...
[modelName '/HVDC_Line'], ...
'Resistance', num2str(Rdc), ...
'Inductance', num2str(Ldc), ...
'Capacitance', num2str(Cdc), ...
'Position', [500 100 550 150]);
%% Add Inverter Bridge
add_block('powerlib/Elements/Universal Bridge', ...
[modelName '/Inverter'], ...
'PowerElectronicDevice', 'Thyristor', ...
'Position', [600 100 650 150]);
%% Add Transformer (Inverter Side)
add_block('powerlib/Elements/Three-Phase Transformer (Two Windings)', ...
[modelName '/Transformer2'], ...
'Position', [700 100 750 150]);
%% Add Load
add_block('powerlib/Elements/Three-Phase Series RLC Load', ...
[modelName '/Load'], ...
'Position', [800 100 850 150]);
%% Add Scopes
add_block('simulink/Commonly Used Blocks/Scope', ...
[modelName '/Voltage Scope'], ...
'Position', [900 100 950 130]);
%% Add Simulation Configuration
set_param(modelName, 'StopTime', '5');
% (Optional) Auto-connect blocks for you
% You can do this manually or use lines like:
% add_line(modelName, 'Block1/1', 'Block2/1');
disp(['Model "', modelName, '" is ready. Open it in Simulink.']);

Answers (1)

Walter Roberson
Walter Roberson on 10 Apr 2025
powerlib/Elements/Three-Phase Source and similar names do not exist. You need for example
sps_lib/Sources/Three-Phase Source and sps_lib/Power Grid Elements/Three-Phase Transformer (Two Windings)
For each element, look up the Libraries line in the appropriate documentation page; for example look at https://www.mathworks.com/help/sps/powersys/ref/threephasetransformertwowindings.html and see
Simscape / Electrical / Specialized Power Systems / Power Grid Elements
under Libraries.
Replace the leading Simscape / Electrical / Specialized Power Systems with sps_lib and remove the spaces around the / and append the official block name.

Categories

Find more on Specialized Power Systems in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!