- Index
- » Users
- » Petrou
- » Profile
Posts
Posts
Doesn't anyone have any idea???
Hello.
Could anyone inform me how to use CombiTime Table component ?
Is there any documentation about this component ?
I tried a lot of things but with no luck.
Thank you very much.
Ok sjoelund.se,
thank you very much for your help.
sjoelund.se,
do you think that different simulation settings will cause no errors?
your help is needed cause i am in a very bad situation...
Thank you.
Thank you for your reply... but i am confused...
What do you mean by saying "...is fixed in r9547" ?
Is there something wrong on my code?
Is there a way to run the simulation and see the results?
In the OMC editor the simulation stops, so i cant see the results...
Ok, thank you very much...
Hello sjoelund.se,
Is it possible to give me your email account to send you my code, or send me an email at : mpexos@yahoo.gr and then reply you the code?
Thank you.
Can you send me an email here: mpexos@yahoo.gr
and then reply you the code?
Hello again,
i correct the post about the error that i am getting...
Does anybody have a clue about this??
Maybe, someone want to exame my code and see if something is wrong there?
Hello,
I am getting the following error:
---- Error 1 : 13:22:52 ----
Unable to simulate the Model 'Tucermodel'
Following Error has occurred.
Simulation failed for model: Tucermodel
Error: Error building simulator. Buildlog: The syntax of the command is incorrect.
gcc -O3 -falign-functions -msse2 -mfpmath=sse -I\"C:/OpenModelica1.7.0//include/omc\" -I. -L\"C:/Users/Tassos\" -c -o Tucermodel.o Tucermodel.c
Tucermodel.c: In function `functionDAE':
Tucermodel.c:15992: error: subscripted value is neither array nor pointer
Tucermodel.c:16026: error: subscripted value is neither array nor pointer
Tucermodel.c:16060: error: subscripted value is neither array nor pointer
Tucermodel.c:16094: error: subscripted value is neither array nor pointer
\\MinGW\\bin\\mingw32-make: *** [Tucermodel.o] Error 1
I am quite sure that the code is correct.
Does anybody have any idea what it migth be wrong?
Thank you very much..
Hello again.
Thank you, i did what you propose to me and everything work good...
I would like to ask something last.
As i said at the start of the topic i want at each time interval to give different values at v(4x1 column-matrix) and resolve the equation: der(x) = A*x + F*v for every different v,
so x has different value at each time interval...
At the end of the simulation i want to plot x (all different values at each time interval of x[1] as one graph. the same for x[2],x[3],...)
I think as i can realize the next code doesn't renew the value of v at each time interval:
model petrou
parameter Real A[14,14] = zeros(14,14);
parameter Real F[14,4] = ones(14,4) * 10.5;
// make it 12 to be sure we don't run out of bounds
parameter Real u[12,4] = ones(12,4) * 1.5;
Real x[14];
Real v[4];
Integer i(start = 0);
equation
i = integer(floor(time + 1));
for j in 1:4 loop
v[j] = u[i,j];
end for;
der(x) = A*x + F*v;
end petrou;
I also used the code you proposed me :
model petrou
parameter Real A[14,14] = zeros(14,14);
parameter Real F[14,4] = ones(14,4) * 10.5;
// make it 12 to be sure we don't run out of bounds
parameter Real u[12,4] = ones(12,4) * 1.5;
Real x[14];
discrete Real y[14];
Real v[4];
Integer i(start = 0);
equation
i = integer(floor(time + 1));
for j in 1:4 loop
v[j] = u[i,j];
end for;
der(x) = A*x + F*v;
when sample(0, 1) then
y = x;
end when;
end petrou;
but i doesnt seems to renew the value of v at each time interval...
As i read and as you proposed to me the equation sample() triggers at each time interval and is the apropriate for what i want.
Because of the continuous nature of equation der() i can't use the next code (i am getting errors) :
equation
when sample(0,1) then
i = integer(floor(time + 1));
for j in 1:4 loop
v[j] = u[i,j];
end for;
der(x) = A*x + F*v;
end when;
Is there a solution for my problem?
Thank you very much for one more time...
I am terribly sorry but obviously i am doing something wrong or i have not understand something...
i am getting errors again...
do i have to save petrou.mo in a specific folder, so to be able to load it as loadFile("petrou.mo") and not loadFile("C:\. . .\petrou.mo")?
i am writting in the OMshell the code for simlation and plotting you send me but i am getting errors...
also the plot3 function does not exist...
the code for model (i use OMC editor) works perfect..(i think)
when i plot there the x[1],x[2],...seems to be right... all the values are raising according to time...
Thank you...
Hello again...
The code you send me is perfect, but as i realize it doesn't support the switch of v at times intervals so to be able to solve the equation: der(x) = A*x + F*v
in each time interval for different v... (Maybe i am wrong.)
I try something like this in your code:
equation
when sample(0,1) then
i = integer(floor(time + 1));
for j in 1:4 loop
v[j] = u[i,j];
end for;
der(x) = A*x + F*v;
end when;
but i am getting error : Error: Invalid left-hand side of when-equation: der(x[1,1]).
and as i read the equations into when statements must have the format x = ...
Is there any solution?
Thank you very much and a big sorry if i am getting annoying...
Thank you very much Mr. Pop,
You are great! I owe you!
Can anyone please help me???
Thank you very much for your answer Adrian.
I try all day what you said to me but i didnt succeed it.
Is it possible to declare u as (for example) 14x10 matrix and at each time interval get a different column of u??
I try this code:
Integer index = 1;
Real V[14,1]
equation
when sample(0, 1) then
for i in 1:14 loop
v[i,1] = u[i,index];
end for;
der(x) = A*x + F*v ;
index=index+1;
end when;
but i am getting errors...
Could you please help me, give some instructions more??
Thank you.
Hello!
I have made a model an i want to solve the state space equation: x' = A*x + F*u
A is a 14x14 matrix
x is a 14x1 column-matrix
F is a 14x4 matrix
and u is 4x1 column-matrix.
My code is : der(x) = A*x + F*u ;
u column-matrix is the input for my system.
I want, at any time time interval, to give a different input u (different column-matrix)
and at the end to be able to plot any element of x column-matrix according to time.
(i want to plot the different values that the element of x column-matrix has take according to input u in one graph).
Has anyone any idea?
I am sorry for my silly questions but it is the first time i use Modelica(3 weeks now).
Thank you.
Thank you very much sjoelund.se .
You saved me...
I install the night build and the problem solved!!!!
Thank you very much again!
I try that!
Do you think it will be better if i use the solve function (as mentioned in function's inv declaration) or the solve2 function?
Hello again.
I made a clean install of modellica 1.7.0.
I create a new model in OMEdit. I haven't insert any component.
I just wrote the next code to test the inverse function:
model dikimh
Real M[2,2] = {{4,3},{3,2}};
Real invM[2,2] = Modelica.Math.Matrices.inv(M);
end dikimh;
And still i am getting the message:
Simulation failed for model: dikimh
Error: Error building simulator. Buildlog: The syntax of the command is incorrect.
g++ -I. -o dikimh.exe dikimh.cpp -L\"C:/OpenModelica1.7.0/tmp\" \"-LC:/OpenModelica1.7.0/lib/omlibrary/msl31/Resources/Library/mingw32\" \"-LC:/OpenModelica1.7.0/lib/omlibrary/msl31/Resources/Library/win32\" \"-LC:/OpenModelica1.7.0/lib/omlibrary/msl31/Resources/Library\" -llapack-mingw -ltmglib-mingw -lblas-mingw -lf2c -lsim -linteractive -I\"C:/OpenModelica1.7.0//include/omc\" -O3 -falign-functions -msse2 -mfpmath=sse -lsendData -lQtNetwork-mingw -lQtCore-mingw -lQtGui-mingw -luuid -lole32 -lws2_32 -L\"C:/OpenModelica1.7.0//lib/omc\" -lc_runtime -lregex -Wl,-Bstatic -lf2c -Wl,-Bdynamic dikimh_records.c
C:/OpenModelica1.7.0//lib/omc/libsim.a(simulation_runtime.o):simulation_runtime.cpp:(.text+0x44d0): multiple definition of `_main'
C:/OpenModelica1.7.0//lib/omc/libf2c.a(main.o).text+0x70): first defined here
C:/OpenModelica1.7.0//lib/omc/libc_runtime.a(dlinpk.o):dlinpk.c.text+0x240): multiple definition of `_dscal_'
C:/OpenModelica1.7.0//lib/omc/libblas-mingw.a(dscal.o):dscal.f.text+0x0): first defined here
C:/OpenModelica1.7.0//lib/omc/libc_runtime.a(dlinpk.o):dlinpk.c.text+0x0): multiple definition of `_idamax_'
C:/OpenModelica1.7.0//lib/omc/libblas-mingw.a(idamax.o):idamax.f.text+0x0): first defined here
C:/OpenModelica1.7.0//lib/omc/libf2c.a(main.o).text+0x113): undefined reference to `_MAIN__'
collect2: ld returned 1 exit status
\\MinGW\\bin\\mingw32-make: *** [dikimh] Error 1
Could you please inform what i made wrong???
Thank you.
I write to OMshell " loadModel(Modelica) " and i get true.
I also fix the call to Modelica.Math.Matrices.inv(M).
My full call was:
Real s [7,7] = Modelica.Math.Matrices.inv(M);
and i get the next message:
{"",""}
"Error: Error building simulator. Buildlog: g++ -I"C:\OpenModelica1.5.0/include" -msse2 -mfpmath=sse -I. -I"C:/Users/Tassos/Desktop/tucer/Modelica" -o tucermodel.exe tucermodel.cpp -L"C:/Users/Tassos/Desktop/tucer/Modelica" -lsim -L"C:\OpenModelica1.5.0/lib" -lc_runtime -lf2c -lsendData -lQtNetwork-mingw -lQtCore-mingw -lQtGui-mingw -luuid -lole32 -lws2_32 Lapack
In file included from tucermodel.cpp:13:
tucermodel_functions.cpp: In function `int in_Modelica_Math_Matrices_LAPACK_dgetrf(type_description*, type_description*)':
tucermodel_functions.cpp:91: warning: converting to `modelica_integer' from `const double'
tucermodel_functions.cpp:99: error: cannot convert `real_array*' to `const int*' for argument `1' to `void dgetrf_(const int*, const int*, double*, const int*, int*, int*)'
tucermodel_functions.cpp: In function `Modelica_Math_Matrices_LAPACK_dgetrf_rettype _Modelica_Math_Matrices_LAPACK_dgetrf(real_array)':
tucermodel_functions.cpp:130: warning: converting to `modelica_integer' from `const double'
tucermodel_functions.cpp:137: error: cannot convert `real_array*' to `const int*' for argument `1' to `void dgetrf_(const int*, const int*, double*, const int*, int*, int*)'
tucermodel_functions.cpp: In function `int in_Modelica_Math_Matrices_LAPACK_dgetri(type_description*, type_description*)':
tucermodel_functions.cpp:174: warning: converting to `modelica_integer' from `const double'
tucermodel_functions.cpp:183: error: cannot convert `real_array*' to `const int*' for argument `1' to `void dgetri_(const int*, double*, const int*, const int*, double*, int*, int*)'
tucermodel_functions.cpp: In function `Modelica_Math_Matrices_LAPACK_dgetri_rettype _Modelica_Math_Matrices_LAPACK_dgetri(real_array, integer_array)':
tucermodel_functions.cpp:209: error: `work' was not declared in this scope
tucermodel_functions.cpp:210: error: `lwork' was not declared in this scope
tucermodel_functions.cpp:210: error: `info' was not declared in this scope
g++: Lapack: No such file or directory
mingw32-make: *** [tucermodel] Error 1
Error: Error building simulator. Buildlog: command g++ not found. Check $OPENMODELICAHOME
Error: Error building simulator. Buildlog: command "C:\OpenModelica1.5.0/bin/Compile" not found. Check $OPENMODELICAHOME
"
I am sorry if my questions are annoying to you but i am lost...
Thank you again...
Thank you very much for your answer.
I try what yopu said to me but i am getting this message:
{"",""}
"Error: Class Modelica.Matrices.inv (its type) not found in scope tucermodel.
Error: No matching function found for Modelica.Matrices.inv
Error: Class Modelica.Matrices.inv not found in scope tucermodel.
Error: Error occured while flattening model tucermodel
"
...
What does this means?
Hello!
I am new in modellica language and i face a lot of problems...
Could someone explain to me how to compute the inverse matrix of a square matrix.
Thank you very much.
- Index
- » Users
- » Petrou
- » Profile