MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

changing replacement rule arrow ( ->) to equal sign(==)...


thanks for all those tho replied regarding adding interpoating
functions.

few more questions...

let's say you can Solve a system of equations like this. 

In[267]:=
itxn = Solve[{0 == 1 - 2C[t] - 1 C[t] tf[t] + 2 tfC[t], 
          0 == -1  G[t] + 2 tfC[t], 
          0 == 1 - 2 tf[t] - 1 C[t] tf[t] + 2 tfC[t], 
          0 == 1 C[t] 2 tf[t] - 1 tfC[t] - 2 tfC[t]}, {C[t], G[t],
tf[t],
          tfC[t]}][[1]] /. t -> 0

above give a replacement rule as below. 

{G[0] -> 4*(5 - 2*Sqrt[6]), tfC[0] -> 2*(5 - 2*Sqrt[6]), 
 C[0] -> 3 - Sqrt[6], tf[0] -> 3 - Sqrt[6]}

now I would like to use this rule asd part of NDSolve as initial
conditions. but as we all know, it can't be used directly.

the -> needs to be replaced with == 

now, if i try to Map a rule that replaces -> with ==, like...

Map[{itxn[[1]] == itxn[[2]]}, itxn]

it doesn't work. 

it gives a long list with wrong result. 

what i wanted though is 
{G[0] == 4*(5 - 2*Sqrt[6]), tfC[0] == 2*(5 - 2*Sqrt[6]), 
 C[0] == 3 - Sqrt[6], tf[0] == 3 - Sqrt[6]}

So, what i would like to do is use the results from the Solve directly
in NDSolve as the initial conditions without having to manually edit
out the arrows with equal signs.

can you guys please shed some light on this matter? 

thank you very much in advance

sean


  • Prev by Date: Re: adding subset of interpolating function from a system of ODE
  • Next by Date: Difference of numbers in the list
  • Previous by thread: Re: Creating New Symbols
  • Next by thread: Re: changing replacement rule arrow ( ->) to equal sign(==)...