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

Simulation of a non-linear distributed system

Simulation of a non-linear distributed system

Hi!

When trying to simulate a system, actually, a meter test for a subsystem
TheSubsystem.mo

aTestSystem.mo
where the interesting part is these equations:

  T[1]=Tin;
  for i in 1:n loop
    rho_F[i]= xxx * T[i] ^2 +xxx * T[i] + xxx;
    Cp_F[i]= xxx * T[i] + xxx;
   (xxx+xxx*rho_F[i]*Cp_F[i])*der(T[i]) = E*d*xxx*(T[i]-Ta) + Q*Cp_F[i]*(T[i] - T[i+1]);
  end for;

where the state variables are the T[n+1]; there are a couple of state-dependent variables; rho_F[n], Cp_F[n];
a few input variables: Tin, E, d, Q; and everything else are whatever numbers and parameters: xxx

It checks OK, for instance, with a low n:
Check completed successfully.
Class has 107 equation(s) and 107 variable(s).
11 of these are trivial equation(s).

But it crashes (Fatal error in GC: Too many heap sections)

Since it is quite small, I attach it.

Thanks for any hint.

There are 0 guests and 0 other users also viewing this topic
You are here: