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
  • Index
  • » Users
  • » Loni
  • » Profile

Posts

Posts

Jun-14-12 20:47:01
errors when opening files

Everytime I save my files it seems to work just fine. However, when I try and open them again it says:

error has occured while loading the file
redefing models 'name of my model'
delete the existing models before loading the file

Can anyone tell me what this means and how to make it stop happening

Thank you,

I want to integrate the incubating funtion again so I can determine the total number of infected people throughout the 180 days. I tried adding this variable:

Real TotalInfected (start = 0);

And then I didnte know how to set it to integrate something that would look similar to this (only coded correctly):

TotalInfected = (1/IncubationTime)*integral(Incubating,0,180);

This is obviously incorrect I just don't know how to code the regular integral

This is a really ridiculous question and I feel quite silly asking it but how do you integrate on of the functions you have defined. I am modeling Spanish Influenza and it will not let me integrate the number of incubating people...

model Influenza
  // Parameters
  parameter Real MortalityProb(start = 0.01);
  parameter Real RecoveryTime(start = 2.5);
  // In days
  parameter Real MortalityTime(start = 1);
  // In days
  parameter Real TransmissionProb(start = 0.15);
  parameter Real EncounterRate(start = 4);
  // People per day
  parameter Real IncubationTime(start = 2.5);
  // In days
  // Start variables
  Real Removed(start = 0);
  Real Deceased(start = 0);
  Real Recovered(start = 0);
  Real Infectious(start = 1000);
  Real Incubating(start = 0);
  Real Susceptible(start = 103267000);

  Real Population;
  Real R;
  annotation(experiment(StartTime = 0.0, StopTime = 180.0, Tolerance = 1e-006));
equation
  Population = Recovered + Infectious + Incubating + Susceptible;
  R = (TransmissionProb * EncounterRate * Susceptible) / Population;
  Deceased = MortalityProb * Removed;
  Recovered = (1 - MortalityProb) * Removed;
  der(Removed) = (MortalityProb / MortalityTime + (1 - MortalityProb) / RecoveryTime) * Infectious;
  der(Infectious) = -der(Removed) + Incubating / IncubationTime;
  der(Susceptible) = -R * Infectious;
  der(Incubating) = -Incubating / IncubationTime + R * Infectious;

end Influenza;
The incubation equation is listed above

I would appreciate any help

Thanks

  • Index
  • » Users
  • » Loni
  • » Profile
You are here: