Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Non linear equation system

Non linear equation system

Hi,

Im an engineering student in France working on the simulation of load flow on power grids in permanent state (no time involved)

I have a non-linear equation system to solve ( non linearity comes from sine and cosine). I am new to OpenModelica, so can anyone help me with this? is OpenModelica able to solve the system all by itself or should i program the algorithm (in this case Newton-Raphson) ?

Thanks

Re: Non linear equation system

Code:

class A

  Real c = 0.2;
  Real x = (1-c)*sin(x) + c*cos(x);
end A;

-or-

Code:

class A

  parameter Real c = 0.2;
  Real x = (1-c)*sin(x) + c*cos(x);
end A;

The first example solves the equation in each time step (using the previous value as an initial guess, so it basically only verifies that the equation is solved in all time steps except the first). It uses Powell's Hybrid method.

The second examples solves the non-linear equation during initialization. The default initialization method uses simplex.

Note that a Modelica tool is free to choose any algorithm it wants to solve an equation system, and tool-specific tweaks need to be used if you need to change the defaults current/smile

Re: Non linear equation system

Thank you very much.

And if i have an equation system ? note that im working in steady state so no time is involved.

Re: Non linear equation system

    Marcdaoud
» Have you got the results for Newton Raphson method, if yes Please guide me on that Non linear equation system as am doing my MTech Project on this topic only using Modelica language on OpenModelica platfom.

Re: Non linear equation system

ChanduKumar K
mail Id: chandukumark@gmail.com

Re: Non linear equation system

Modelica is a simulation language and therefore is designed to solve over time.
However, maybe it is good enough to solve load flow equations in the initial equation section.

For instance the following simple two equation set finds "gammaBase" and "wElBase" that are the optimal gamma angle and the electrical base speed of a permanent-magnet synchronous electric drive, for nominal current Inom (maybe as an electric engineering student you know what I mean).
Vnom, Inom, Ld, Lq, IpmRMS are known in advance. They play the role of resistances and inductances in load flow, while gammaBase and wElBase are the unknowns (they can be for instance theta and V in a P-Q node in a load flow problem)

Code:

  

parameter Real Vnom, Ld, Psi, Lq;
parameter Real nBase(fixed=false), gammaBase(fixed=false);
initial equation
Unom^2 = wElBase^2*((Ld*(IpmRMS - Inom)*sin(gammaBase))^2 + (Lq*Inom*cos(
    gammaBase))^2);
  0 = (-Ld*IpmRMS*sin(gammaBase)) + (Lq - Ld)*Inom*cos(2*gammaBase);

Edited by: ceraolo - Feb-26-15 22:23:28
There are 0 guests and 0 other users also viewing this topic