- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Can we further optimize on the number...
Can we further optimize on the number of equations in OpenModelica
Can we further optimize on the number of equations in OpenModelica
For a simple RC circuit with an AC source 3 equations should be suffcicient to solve. But openModelica genrates around 21 equations. Even after optimization the number of equation is 5. How to reduce it further?
Re: Can we further optimize on the number of equations in OpenModelica
I tried a serial RC circuit in OMEdit and got only 2 equations...
eq: capacitor1.n.i = sinecurrent1.signalSource.offset + (if time < sinecurrent1.signalSource.startTime then 0.0 else sinecurrent1.signalSource.amplitude * sin(6.28318530717959 * (sinecurrent1.signalSource.freqHz * (time - sinecurrent1.signalSource.startTime)) + sinecurrent1.signalSource.phase));
eq: der(capacitor1.v) = DIVISION(-capacitor1.n.i,capacitor1.C,"(-capacitor1.n.i) / capacitor1.C because capacitor1.C == 0");
Parallel RC gives 4 equations (4th comes from the conditional heat port):
eq: capacitor1.n.i = DIVISION(capacitor1.v,resistor1.R_actual,"capacitor1.v / resistor1.R_actual because resistor1.R_actual == 0");
eq: resistor1.LossPower = capacitor1.v * capacitor1.n.i;
eq: der(capacitor1.v) = DIVISION(-capacitor1.n.i,capacitor1.C,"(-capacitor1.n.i) / capacitor1.C because capacitor1.C == 0");
eq: sinecurrent1.n.i = (-(if time < sinecurrent1.signalSource.startTime then 0.0 else sinecurrent1.signalSource.amplitude * sin(6.28318530717959 * (sinecurrent1.signalSource.freqHz * (time - sinecurrent1.signalSource.startTime)) + sinecurrent1.signalSource.phase))) - sinecurrent1.signalSource.offset;
How did you check how many equations were generated?
- sjoelund.se
- 1700 Posts
Re: Can we further optimize on the number of equations in OpenModelica
I listed the number of equations that were generated after optimization. After flattening it will contain as many equations as there are variables (there is no way around that). But after optimization very few are left.
- sjoelund.se
- 1700 Posts
Re: Can we further optimize on the number of equations in OpenModelica
Yes sir, you are right. Very few equations are left after optimization, but still is it not more than the number of equations formed by nodal analysis or Modified Nodal Analysis. In spite of optimization I feel some redundant equations are formed. Have I communicated what I wanted to? I don't know please let me know?
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Can we further optimize on the number...