<commit_before>within OpenIPSL.Electrical.Buses;
model InfiniteBus "PSAT Infinite Bus"
  extends OpenIPSL.Electrical.Essentials.pfComponent(
    enableS_b=true,
    enabledisplayPF=true,
    enableangle_0=true,
    enablev_0=true);
  SI.ActivePower P(displayUnit="MW") "Active Power absorbed by the Infinite bus";
  SI.ReactivePower Q(displayUnit="Mvar") "Reactive Power absorbed by the Infinite bus (MVAr)";
  Interfaces.PwPin p
    annotation (Placement(transformation(extent={{90,-10},{110,10}})));

equation
  p.vr = v_0*cos(angle_0*C.pi/180);
  p.vi = v_0*sin(angle_0*C.pi/180);
  P = -(p.vr*p.ir + p.vi*p.ii)*S_b;
  Q = -(p.vr*p.ii - p.vi*p.ir)*S_b;
  annotation (
    Icon(coordinateSystem(
        extent={{-100,-100},{100,100}},
        preserveAspectRatio=false,
        grid={2,2}), graphics={Rectangle(
          extent={{-100,-100},{100,100}},
          lineColor={0,0,0},
          fillColor={241,241,241},
          fillPattern=FillPattern.Solid),Text(
          visible=displayPF,
          extent={{-80,100},{80,20}},
          lineColor={255,0,0},
          textString=DynamicSelect("0.0 MW",
            OpenIPSL.NonElectrical.Functions.displayPower(P, " MW"))),Polygon(
          visible=displayPF,
          points=DynamicSelect({{-20,30},{-20,10},{20,20},{-20,30}}, if P >= 0
             then {{-20,30},{-20,10},{20,20},{-20,30}} else {{20,30},{20,10},{-20,
            20},{20,30}}),
          lineColor={255,0,0},
          fillColor={255,0,0},
          fillPattern=FillPattern.Solid),Text(
          visible=displayPF,
          extent={{-80,-20},{80,-100}},
          lineColor={0,255,0},<commit_msg>Fix a minus in the Q calculation of infiniteBus.<commit_after>within OpenIPSL.Electrical.Buses;
model InfiniteBus "PSAT Infinite Bus"
  extends OpenIPSL.Electrical.Essentials.pfComponent(
    enableS_b=true,
    enabledisplayPF=true,
    enableangle_0=true,
    enablev_0=true);
  SI.ActivePower P(displayUnit="MW") "Active Power absorbed by the Infinite bus";
  SI.ReactivePower Q(displayUnit="Mvar") "Reactive Power absorbed by the Infinite bus (MVAr)";
  Interfaces.PwPin p
    annotation (Placement(transformation(extent={{90,-10},{110,10}})));

equation
  p.vr = v_0*cos(angle_0*C.pi/180);
  p.vi = v_0*sin(angle_0*C.pi/180);
  P = -(p.vr*p.ir + p.vi*p.ii)*S_b;
  Q = (p.vr*p.ii - p.vi*p.ir)*S_b;
  annotation (
    Icon(coordinateSystem(
        extent={{-100,-100},{100,100}},
        preserveAspectRatio=false,
        grid={2,2}), graphics={Rectangle(
          extent={{-100,-100},{100,100}},
          lineColor={0,0,0},
          fillColor={241,241,241},
          fillPattern=FillPattern.Solid),Text(
          visible=displayPF,
          extent={{-80,100},{80,20}},
          lineColor={255,0,0},
          textString=DynamicSelect("0.0 MW",
            OpenIPSL.NonElectrical.Functions.displayPower(P, " MW"))),Polygon(
          visible=displayPF,
          points=DynamicSelect({{-20,30},{-20,10},{20,20},{-20,30}}, if P >= 0
             then {{-20,30},{-20,10},{20,20},{-20,30}} else {{20,30},{20,10},{-20,
            20},{20,30}}),
          lineColor={255,0,0},
          fillColor={255,0,0},
          fillPattern=FillPattern.Solid),Text(
          visible=displayPF,
          extent={{-80,-20},{80,-100}},
          lineColor={0,255,0},
{'fraction_non_alphanumeric': 0.18541033434650456, 'fraction_numerical': 0.08996960486322189, 'mean_word_length': 3.0780669144981414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7377987', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1175, 'n_words': 167}