modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
471 stars 168 forks source link

Missing concept for handling the initial conditions of capacitances #3168

Open beutlich opened 4 years ago

beutlich commented 4 years ago

See https://github.com/modelica/ModelicaStandardLibrary/issues/2146#issuecomment-387703451.

christiankral commented 4 years ago

The title of this ticket suggests that we have a general problem with initialization of capacitors. I suppose this is not the case. How I understand the ticket, this issue is related with the NPN transistor models in the package Analog.Semiconductors.

@beutlich Is this correct? If yes we may consider to update the title of this ticket.

beutlich commented 4 years ago

How I understand the ticket, this issue is related with the NPN transistor

https://github.com/modelica/ModelicaStandardLibrary/issues/2146#issuecomment-387703451 from @kristinmajetta reads:

This concerns other models containing capacitances besides the NPN model.

To me it sounded that it is a rather general issue.

christiankral commented 4 years ago

https://github.com/modelica/ModelicaStandardLibrary/issues/2146#issuecomment-387703451 refers to capacitor initial voltages used in textual (semiconductor) models. In PR #3183 it is proposed to used the following initial conditions for both the NPN (where it is already done) and the PNP bipolar transistor:

initial equation 
  if UIC then
    vcs = IC;
  end if;

Alternatively it may make sense to use start values for the potential differences of the transistor models:

  SI.Voltage vbe(start = 0) "Base-emitter voltage";
  SI.Voltage vcs(start = IC, fixed = UIC) "Collector-substrate voltage";

Then the initial conditions of the two voltages described in https://github.com/modelica/ModelicaStandardLibrary/issues/2146#issue-200863231 can be treated in the GUI (of OpenModelica and Dymola) with no issue. Is this a proper solution to solve this ticket?

beutlich commented 4 years ago

I believe, the unused parameter UIC of Modelica.Electrical.Spice3.Basic.C_Capacitor also belongs here.