solving equations
- To: mathgroup at smc.vnet.net
- Subject: [mg105907] solving equations
- From: Maria Davis <arbiadr at gmail.com>
- Date: Thu, 24 Dec 2009 20:58:48 -0500 (EST)
My file a.txt contains these equations:
x == Csource.receiverRole.RT
Csource.receiverRole.RT == Csource.sendRole.RT + Csource.TT
Csource.sendRole.RT == A.inputPort.RT
A.inputPort.RT == A.outputPort.RT + A.PT
A.ouputPort.RT == C.receiverRole.RT
C.receiverRole.RT == C.sendRole.RT + C.TT
C.sendRole.RT == B.inputPort.RT
B.inputPort.RT == B.outputPort.RT + B.PT
B.ouputPort.RT == Csink.receiverRole.RT
Csink.receiverRole.RT == Csink.sendRole.RT + Csink.TT
Csink.sendRole.RT == DataSink.inputPort.RT
DataSink.inputPort.RT == 0
Csource.TT == 0
Csink.TT == 0
C.TT == 0.5
A.PT == 2
B.PT == 1.5
For solving these equations for x , I tried to omit the caracter '.',
because, as certain have adviced, Mathematica interprets the dot as a
product.
I replaced the dot by a letter 'a' (for trial) using a code given by
dr DanW:
dots = ReadList["a.txt", Record, RecordSeparators -> {}]
nodots = StringReplace[dots[[1]], StringExpression
[pre:LetterCharacter, ".", post:LetterCharacter] :> StringJoin[pre,
"a", post]]
Solve[ReadList[StringToStream[nodots], Expression], {x}]
I have verified that for example a varible name:
Csource.receiverRole.RT has changed to CsourceareceiverRoleaRT. But
the resolution of the system returns a wrong value:
{{x -> CsourceasendRoleaRT}}
Do you know if Mathematica has constraints on the length of the
variable name (it must not exeed a certain value)?
Thank you in advance.