Guidelines for Coding
All the guidelines should be followed without fail for timely acceptance of code and award of the internship. Failure to do so might result in a rejection of your work.
Strictly use OpenModelica 1.9.6 and higher versions for coding.
Do not use any alphas/betas/nightly builds versions for coding in TextBook Companion Internship. Use the stable release versions only.
The codes should follow the naming convention as given below; the codes will not be approved if the naming convention is not followed as instructed. For example, 3rd solved problem from chapter 1 (Example 1.3) should be represented by code named as Ex1_3.mo.
Use package, model, function, record Specialisations for each problem, as per need.
Name of the code and name of the model/class should be the same. If an example is named as Ex1_3.mo then the model should also be named as model Ex1_3.
If problems have subparts, then code it as a package containing its subparts as models.
The dependencies on other codes/functions (if any) should be mentioned as a comment clearly before starting the code.
If the textbook contains significant errors(More than 2 % deviation in calculations/results), mention the same as a comment at the end such as
- "The answer may slightly vary due to rounding off values"
- "The answer provided in the textbook is wrong"
Do not reproduce exact problem statements or text from the textbooks, in your code.
Coding of examples by reproducing them from any other sources is not allowed. Any contributor found guilty of any such copying will be penalized.
It is mandatory to specify units (if any) and description of all variables, parameters and constants during declaration.
The units and description for the variables must be mentioned in a manner that they are being compiled and displayed alongside variable values under plotting perspective. A sample file is attached here for reference.
Appropriate comments should be put up, wherever needed, which will make the code easily understandable. The comments should help in highlighting the flow of logic being used. For example, an equation like R = V/I can have commented as "Ohm's Law" along with it.
The symbols used in the code should be the same as those being used in the textbook.
If any changes are made or any further information is added to the Simulation Setup window to run any particular code, please comment the same at the beginning of the code.