How do I design create .ssc compoenent
1 view (last 30 days)
Show older comments
Hello All,
I'm trying to write and ssc component for bi directional buck boost converter,which allows the current(power) to flow on either sides depending on the conditions.Hence,when I connect two batteries using a converter in between,the converter should be able to charge and discharge both the batteries depending on the inout conditions .It is working fine for side1 but not for side2.What could be the cause for error .Kindly help
component Boost_DifferentialRef
% Boost_DifferentialRef
nodes
p1=foundation.electrical.electrical; % 1+:top
n1=foundation.electrical.electrical; % 1-:top
p2=foundation.electrical.electrical; % 2+:bottom
n2=foundation.electrical.electrical; % 2-:bottom
end
inputs
% Vcontrol={0,'1'}; % Control:bottom
FailureMode={ 1, '1' } % Failure mode: top
Source_at_1={ 1, '1' } % Source1: top
Source_at_2={ 1, '1' } % Source2: top
end
outputs
Status={1,'1'}; % Status :bottom
end
parameters
Efficiency ={ 0.9, '1' };% Power Efficiency
% Vout={28,'V'}; % Output Voltage
DC_required={ 540, '1' };% Voltage regulation
VoltageError={ 1e-3, '1' }; % Voltage error
end
parameters(Hidden=true)
Kc={1,'A'};
Kv={1,'V'};
end
variables
ip1 = { 0, 'A' }; % input Current1
v1 = { 0, 'V' }; % input Voltage1
in1 = { 0, 'A' }; % input Current2
v2 = { 0, 'V' }; % input Voltage2
in2 = { 0, 'A' }; % output Current2
v4 = { 0, 'V' }; % output Voltage2
v3={0,'V'}; % output Voltage1
ip2= { 0, 'A' }; % output Current1
% idc = { 0, 'A' }; % output Current
Pin= { 0, 'W' }; % Input power
Pout = { 0, 'W' }; % output power
Losses={ 0, 'W' }; % power loss
end
variables(Access=protected)
Eff ={ 1, '1' };
M= { 1, '1' }; % ratio
end
branches
ip1 : p1.i->*;
in1 : n1.i -> *;
ip2 : p2.i-> *;
in2: n2.i-> *;
end
equations
v1 == p1.v ;
v2 == n1.v ;
v3 == p2.v ;
v4 == n2.v ;
if FailureMode>0 && Source_at_1 == 1 && abs(v1)> 0.1*Kv
v3 == Kv*(DC_required)/2;
v4 == -Kv*(DC_required)/2;
M==abs((v3-v4)/(v1-v2));
ip1 == -ip2*M;
in1 == -in2*M;
Pin == v1*ip1;
Pout== Efficiency *Pin
Eff== Efficiency;
Losses==Pin*(1-Efficiency);
Status==1;
elseif FailureMode>0 && Source_at_2 == 1 && abs(v3)> 0.1*Kv
v1 == Kv*(DC_required)/2;
v2 == -Kv*(DC_required)/2;
M == abs((v1-v2)/(v3-v4));
ip2 == -ip1*M;
in2 == -in1*M;
Pin==(v3)*(ip2);
Pout== Efficiency *Pin
Eff== Efficiency;
Losses==Pin*(1-Efficiency);
Status==1;
else
v1==0;
v2==0;
M==0;
ip1 ==0;
in1 ==0;
Pin==0;
Pout== 0;
Eff== Efficiency;
Losses==0;
Status==0;
end
% idc==abs(i3);
end
end
0 Comments
Answers (0)
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!