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

Posts

Posts

Dec-05-19 14:10:31
Category: Programming

Does somebody know the answer?

current/big_smile

Nov-29-19 10:32:43
Category: Programming

Ok, i think i solved this problem with your help current/smile
I've done it without saving. Just copy and paste the command output.

Next question. How do i assign one start value for each cell in a 3D Matrix with variable size? Like this

Code:


...
Integer ni=3;
Integer nj=3;
Integer nk=3;

Real Tc_start=50;

Real Tc[ni,nj,nk](start=Tc_start);
...

Thanks again!

Nov-28-19 10:04:13
Category: Programming

Thanks for your answer!

Ok, this seems to be a good method to solve this problem. But the next problem is, that i don't have all these functions ( loadString, loadFile, writeFile, readFile) in Dymola. Do i have to activate them in the options or something?

Nov-27-19 16:48:10
Category: Programming

Hi there!

I am a moderate experienced Modelica (Dymola) User. So i hope you guys could help me. current/smile

I want to build up a model with a huge number of ports (>60). They are named like "portxn_1_1, portxn_2_1, portxn_3_1, portxn_1_2, portxn_1_2, ..." and so on.
The first thing is that i don't want to connect them in the diagram editor or by manually programing to connect them with other variables, like this "portxn_1_1.T = Txn[1,1] ; portxn_2_1.T = Txn[2,1] ; portxn_3_1.T = Txn[3,1] ; ..." . So i tried to connect them by a loop, which loops through the numbers "1_1" of the "portxn".
For example like this:

for i in 1:ni loop
  portxn_"i"_1.T = Txn[i,1];
end for;

That's the first problem. At my point of view there is no opportunity to loop through a String in Modelica. My first idea was to program the loop in C and include it with as a external function.

Is this the right way? Does anybody have some ideas? Maybe a example or something?  current/smile
Thanks!

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