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
  • » Vadim
  • » Profile

Posts

Posts

Jul-01-10 10:56:57
Vector/Matrix operation, algorithm section

Thanks for the answer. I hope a problem in due course it will be resolved.

Jun-30-10 14:03:48
Vector/Matrix operation, algorithm section

Hello,
I am a new openmodelica user.
I try to write vector/matrix operations in algorithm section.
For example:

Code:

class mvmul

  Real res[3];
  Real m[3,3]={{1,0,0},{0,0.5,0},{0,0,1}};
  Real v[3]={1,1,1};
  algorithm
  res:=m*v;
end mvmul;

After "Check":

Code:

Class mvmul has 13 equation(s) and 15 variable(s). 12 of these are trivial equations.

After "Simulate" :

Code:

{"",""}

"Error: Too few equations, underdetermined system. The model has 1 equation(s) and 3 variable(s)
"

Result of 'm*v' has dimension [3] and res[3]. But system interpreted 'm*v' dimension as [1].
what is wrong in my code?

Thank you.

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