Skip to content

Commit

Permalink
not satisfiable attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
AtiyahElsheikh committed Jul 25, 2019
1 parent cd7193c commit 782f27c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
4 changes: 2 additions & 2 deletions MSL/Electrical/Analog/Interfaces/OnePort.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ partial model OnePort

Modelica.SIunits.Voltage v "Voltage drop between the two pins (= p.v - n.v)";
Modelica.SIunits.Current i "Current flowing from pin p to pin n";
replaceable ADMSL.MSL.Electrical.Analog.Interfaces.PositivePin p
ADMSL.MSL.Electrical.Analog.Interfaces.PositivePin p
"Positive pin (potential p.v > n.v for positive voltage drop v)" annotation (Placement(
transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
replaceable ADMSL.MSL.Electrical.Analog.Interfaces.NegativePin n "Negative pin"
ADMSL.MSL.Electrical.Analog.Interfaces.NegativePin n "Negative pin"
annotation (Placement(transformation(extent={{
110,-10},{90,10}}, rotation=0)));
equation
Expand Down
2 changes: 1 addition & 1 deletion T1/Electrical/Analog/Basic/Ground.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within ADMSL.T1.Electrical.Analog.Basic;
model Ground "AD version of Modelica.Electrical.Analog.Basic.Ground"
extends ADMSL.Utilities.GradientInfo;
extends Modelica.Electrical.Analog.Basic.Ground;
extends ADMSL.MSL.Electrical.Analog.Basic.Ground;
redeclare ADMSL.T1.Electrical.Analog.Interfaces.Pin p(NG=NG);

equation
Expand Down
16 changes: 12 additions & 4 deletions T1/Electrical/Analog/Basic/Inductor.mo
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
within ADMSL.T1.Electrical.Analog.Basic;
model Inductor "AD version of Modelica.Electrical.Analog.Basic.Inductor"
extends ADMSL.T1.Electrical.Analog.Interfaces.OnePort(i(start=0));
// extends ADMSL.T1.Electrical.Analog.Interfaces.OnePort(i(start=0));

/*extends ADMSL.MSL.Electrical.Analog.Basic.Inductor;
redeclare replaceable partial model Port = ADMSL.T1.Electrical.Analog.Interfaces.OnePort;
extends Port; */

extends ADMSL.MSL.Electrical.Analog.Basic.Inductor(
redeclare replaceable partial model Port = ADMSL.T1.Electrical.Analog.Interfaces.OnePort);

//extends Modelica.Electrical.Analog.Interfaces.OnePort(i(start=0));
parameter SI.Inductance L(start=1) "Inductance";
// parameter SI.Inductance L(start=1) "Inductance";
parameter Real g_L[NG] = zeros(NG) "The gradient of inductance";

equation
Expand All @@ -11,7 +19,7 @@ equation
g_v[ad_i] = g_L[ad_i] * der(i) + L * der(g_i[ad_i]) ;
end for;

L*der(i) = v;
/* L*der(i) = v;
annotation (
Documentation(info="<html>
<p>The linear inductor connects the branch voltage <em>v</em> with the branch current <em>i</em> by <em>v = L * di/dt</em>. The Inductance <em>L</em> is allowed to be positive, or zero.</p>
Expand Down Expand Up @@ -50,5 +58,5 @@ equation
extent={{-150,90},{150,50}},
textString="%name",
lineColor={0,0,255})}));

*/
end Inductor;
12 changes: 8 additions & 4 deletions T1/Electrical/Analog/Interfaces/OnePort.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ within ADMSL.T1.Electrical.Analog.Interfaces;
partial model OnePort
"AD version of Modelica.Electrical.Analog.Interfaces.OnePort"
extends ADMSL.Utilities.GradientInfo;
extends ADMSL.MSL.Electrical.Analog.Interfaces.OnePort;

SI.Voltage v "Voltage drop between the two pins (= p.v - n.v)";
redeclare ADMSL.T1.Electrical.Analog.Interfaces.NegativePin n(NG=NG);
redeclare ADMSL.T1.Electrical.Analog.Interfaces.PositivePin p(NG=NG);

/* SI.Voltage v "Voltage drop between the two pins (= p.v - n.v)";
SI.Current i "Current flowing from pin p to pin n";
ADMSL.T1.Electrical.Analog.Interfaces.PositivePin p(NG=NG)
Expand All @@ -13,7 +17,7 @@ partial model OnePort
ADMSL.T1.Electrical.Analog.Interfaces.NegativePin n(NG=NG)
"Negative pin"
annotation (Placement(transformation(extent={{
110,-10},{90,10}}, rotation=0)));
110,-10},{90,10}}, rotation=0)));*/

Real g_v[NG];
Real g_i[NG];
Expand All @@ -26,7 +30,7 @@ equation
g_i[ad_i] = p.g_i[ad_i];
end for;

v = p.v - n.v;
/*v = p.v - n.v;
0 = p.i + n.i;
i = p.i;
annotation (
Expand Down Expand Up @@ -67,5 +71,5 @@ equation
extent={{90,45},{110,25}},
lineColor={160,160,164},
textString="i")}));

*/
end OnePort;

0 comments on commit 782f27c

Please sign in to comment.