Saarland University
Lehrstuhl fr Automatisierungstechnik

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Replacing Connect-Statement by equations???, Im trying to understand Modelica ;-)
RungeZipperer
post Jun 15 2009, 02:29 PM
Post #1


Advanced Member
***

Group: Members
Posts: 59
Joined: 14-March 06
Member No.: 4



QUOTE(Roland @ Jun 15 2009, 02:39 PM) *

Therefore you can not connect the tau by hand.


I should have known that. Thanks!

QUOTE(Roland @ Jun 15 2009, 02:39 PM) *

Why? I can see no reason why you would have to avoid the connect statement.


Im trying to find a way to build a variable structure system. As far as I know this is not possible with Modelica at present. I just wanted to experiment with the language to go more into detail.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Roland
post Jun 15 2009, 12:39 PM
Post #2


Advanced Member
***

Group: Members
Posts: 30
Joined: 2-January 08
Member No.: 5,272



Hello RungeZipperer,

QUOTE(RungeZipperer @ Jun 12 2009, 07:18 AM) *
What is so special about the connection?


The connector "Modelica.Mechanics.Rotational.Interfaces.Flange_x" has the flow variable "tau" as member. In Modelica the sum of the flow variables of all connected connectors is automatically set to 0. In your case, the equation is

CODE
constantTorque.flange.tau + inertia.flange_a.tau = 0;


If you do not use the connect statement the sum is still set to 0 - the difference is just, that there is only one variable in the equation. E.g.:

CODE
constantTorque1.flange.tau = 0;


Therefore you can not connect the tau by hand.

QUOTE(RungeZipperer @ Jun 12 2009, 07:18 AM) *
There must be a way to write equations instead of connect()!?


Why? I can see no reason why you would have to avoid the connect statement.

Regards,
Roland
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
RungeZipperer
post Jun 12 2009, 06:18 AM
Post #3


Advanced Member
***

Group: Members
Posts: 59
Joined: 14-March 06
Member No.: 4



Hello,

Im just trying to understand some very basic characteristics of Modelica (and also Dymola). This is my first question (out of a few...):

Look at this example. There is a constant torque connected to a inertia. Ive used the

connect(constantTorque.flange, inertia.flange_a)

for the model on top and then I wanted to replace this by

constantTorque1.flange.phi=inertia1.flange_a.phi;
constantTorque1.flange.tau+inertia1.flange_a.tau=0;


which is not possible. I can leave out one of these equations but I still get the error that "The Real part has 26 unknowns and 27 equations." What is so special about the connection? There must be a way to write equations instead of connect()!?

Can you give me some hints?

CODE

model ConnectTest  
  annotation (Diagram);
  Modelica.Mechanics.Rotational.Inertia inertia
    annotation (extent=[0,50; 20,70]);
  Modelica.Mechanics.Rotational.ConstantTorque constantTorque
    annotation (extent=[-40,50; -20,70]);
  Modelica.Mechanics.Rotational.Inertia inertia1
    annotation (extent=[0,-20; 20,0]);
  Modelica.Mechanics.Rotational.ConstantTorque constantTorque1
    annotation (extent=[-40,-20; -20,0]);
equation
  connect(constantTorque.flange, inertia.flange_a)
    annotation (points=[-20,60; 0,60], style(color=0, rgbcolor={0,0,0}));
  constantTorque1.flange.phi=inertia1.flange_a.phi;
//  constantTorque1.flange.tau+inertia1.flange_a.tau=0;
end ConnectTest;


Attached Image


Attached File(s)
Attached File  ConnectTestTotal.mo ( 46.38k ) Number of downloads: 742
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 23rd September 2019 - 02:06 PM