﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2617	Parentheses in equations.	joakim.sandin@…	Joakim Sandin	"I am running OpenModelica 1.9.0 (r17628) and I have some problems with parentheses/brackets in some of my equations. Below is a simple exampel and I hope the comments in the code will explain the problem. 

model Testar 
  constant Real A = 2; 
  constant Real B = 3; 
  constant Real C = 5; 
  // I wish to whrite equation F as: F = 10 / ((A+B)/2) * C; which is equal to 20 
  // 
  Real G; 
  Real H; 
  Real I; 
  // 
equation 
  // When I save the model, OpenModelica choose to read equation F as in equation G below, without parentheses outside (A+B)/2. But it works fine as long as the model is unsaved.
  G = 10 / (A + B) / 2 * C;     // G = 5 
  // 
  // If i split up equation G, in equation I and H as follows below, I will get the correct answer, which is 20. 
  I = (A + B) / 2;     // I = 2.5 
  H = 10 / I * C;     // H = 20 
  // 
end Testar; 

It is the same issue when calculations are made in parameters and constants.
"	enhancement	closed	high	1.9.1	Frontend	trunk	duplicate	parentheses, brackets, equations	Per Östlund
