Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start values topic should also mention fixed attribute #133

Closed
tbeu opened this issue Apr 18, 2014 · 7 comments
Closed

Start values topic should also mention fixed attribute #133

tbeu opened this issue Apr 18, 2014 · 7 comments

Comments

@tbeu
Copy link
Contributor

tbeu commented Apr 18, 2014

When you speak about start values first time (in Lotka-Volterra Systems) you compare advantages and disadvantages with initial equations. What I miss here is the introduction of the fixed attribute which means - if set to fixed - that the start attribute is no longer just a hint but a fixed initial assignment.

@tbeu
Copy link
Contributor Author

tbeu commented Apr 18, 2014

In fact almost all simple domain models use start values and fixed attributes. Also start values are easier to implement than initial equations for a Modelica compiler vendor.

@tbeu tbeu changed the title Start values topic should also mention fixed attribut Start values topic should also mention fixed attribute Apr 21, 2014
@tbeu
Copy link
Contributor Author

tbeu commented Apr 22, 2014

There is one more strong argument for using the start/fixed attributes in preference. You can modify them, i.e. set them by dialog.

@tbeu
Copy link
Contributor Author

tbeu commented May 12, 2014

Mike, can you please commenr on this issue. I consider it as an important issue not just a matter of taste.

@xogeny
Copy link
Collaborator

xogeny commented May 12, 2014

Thomas, I agree with you in general on this point and I think more discussion on this topic is required in the book. I simply haven't had the time to invest in that part just yet. I have a conference coming up so I'm pretty busy with that at the moment. Hopefully once that is done I'll have a bit more time to think about this.

@xogeny
Copy link
Collaborator

xogeny commented Aug 1, 2014

Thomas, I've added some further discussion about fixed. I don't discuss the modification of start attributes because, frankly, if you really want to allow users to change such things, you should make them parameters (and that works with both initial equations and fixed=true).

@mtiller mtiller closed this as completed in aa1fd7c Aug 1, 2014
@tbeu
Copy link
Contributor Author

tbeu commented Aug 4, 2014

Maybe you also want to add a model that makes use of it. E.g. BasicEquations\LotkaVolterra\ClassicModelFixedStartValues.mo

@tbeu
Copy link
Contributor Author

tbeu commented Oct 21, 2014

This is what I mean

within ModelicaByExample.BasicEquations.LotkaVolterra;
model ClassicModelFixedStartValues "This is the typical equation-oriented model"
  parameter Real alpha=0.1 "Reproduction rate of prey";
  parameter Real beta=0.02 "Mortality rate of predator per prey";
  parameter Real gamma=0.4 "Mortality rate of predator";
  parameter Real delta=0.02 "Reproduction rate of predator per prey";
  parameter Real x0=10 "Initial prey population";
  parameter Real y0=10 "Initial predator population";
  Real x(start=x0, fixed=true) "Prey population";
  Real y(start=y0, fixed=true) "Predator population";
equation
  der(x) = x*(alpha-beta*y);
  der(y) = y*(delta*x-gamma);
end ClassicModelFixedStartValues;

xie-dongping pushed a commit to xie-dongping/ModelicaBook that referenced this issue Mar 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants