Adrian Pop
Fri, 05 Feb 2010 10:11:20 -0800
Hi Andrey, This message got bounced to me for approval. Andrey you need to become a list member to be able to send emails to openmodelicainterest. See here how: http://www.openmodelica.org/index.php/home/mailing-list Cheers, Adrian Pop/ On 2010-02-05 16:51, owner-openmodelicainter...@ida.liu.se wrote:
From: Andrey Behrens<andrey.behr...@openaqua.de> To: openmodelicainterest@ida.liu.se Subject: input doesn't match output Date: Fri, 5 Feb 2010 16:51:15 +0100
Hello,
the attached model seems be broken. The idea is to have a building which
produces money (10 units per second).
The money shall be stored in a storage.
WW connects to money producer with the storage via a connect statement.
If I let run the model and look at the results the Building seems to work. At
the first second I get 10 units. The units appears at the same moment on the
storage.
But the addition seems not to work.
At first the addition doubles the income. At second the addition will be done
two times per second.
I don't see the problem. Can someone help me?
Kindly Regards
----------------------------------------------------
//==============================================
connector MoneyInput output Real m; end MoneyInput;
connector MoneyOutput input Real m; end MoneyOutput;
//==============================================
class Building
parameter Real value=10;
discrete MoneyOutput outcome;
equation
when sample(1,1) then
outcome.m=value;
end when;
end Building;
//==============================================
class Storage
discrete Real storage(start=0);
discrete MoneyInput income;
equation
storage = pre(storage)+income.m;
end Storage;
//==============================================
model WW
Building depot;
Storage storage;
equation
connect(depot.out, storage.income);
end WW;
-- _____________________________________________________________________ Adrian Pop | PhD Open Source Modelica Consortium | Technical Coordinator Department of Computer Science | http://www.ida.liu.se/~adrpo Linköping University | phone:+46 76 2343499/+46 13 285781 S-581 83 Linköping, Sweden | fax: +46 13 142231 OSMC & LiU/IDA/PELAB | office: 3B:478