Hi,
Can somebody recommend the best way to write mathematica script to solve this system of equations :
S=tS + tA(t) +tB(t) +1
A(t)= tC(t) + tE(t)
B(t)= tD(t) + tF(t)
C(t)= tS(t) + tB(t)
D(t)= tS(t) + tA(t)
F(t)= tC(t)
E(t)= tD(t)
Thanks
Very thanks
Hi Massimo,
Here is some information on using the rules provided by Solve. And also in the attached notebook.
In[2]:= (* Solve provided rules which can be used with Replace to \ extract expressions for the vvariables it solved for *) (* /. is a short form of Replace *) In[3]:= s /. generalSolution Out[3]= (-1 + t^2 + t^3)/(-1 + t + t^2 + 2 t^3 + t^4) In[4]:= (* This expression can be used to define a function. I give \ it another name for convenience. *) In[5]:= fs[t_] = s /. generalSolution; In[6]:= (* now it can be used as a function *) In[7]:= fs[a] Out[7]= (-1 + a^2 + a^3)/(-1 + a + a^2 + 2 a^3 + a^4)
s -> (s /. generalSolution)
Thanks for reply .. but I'd like to have this function:
generalSolution = Simplify@Solve[{s == t s + t a + t b + 1, a == t c + t e, b == t d + t f, c == t s + t b, d == t s + t a, f == t c, e == t d}][[1]]; s /. generalSolution
You can read the documentation on Solve (Examples > Scope > Basic Uses) on how to extract values from a solution in Mathematica format.
Now .. How can I refer to the function s?
I want to print just this function..
Thanks!
Great!
This is a very unclear question, both in terms of Mathematica and in the underlying mathematics. Here are a few suggestions.
(1) Pare it down to a smaller example.
(2) Explain clearly what is desired both for input and output.
(3) As part of item (2) make sure to explain carefully if this is intended to be a system of differential equations, difference equations, polynomial equations, or womething else entirely.
(4) As part of item (3), make sure to explain what you have in mind when mentioning "the s generating function".
Sorry, ..anyway the request is solved!
Bye!
Mathematica is allergic to some big letters.
eqs = { s == t*s + t*a + t*b + 1, a == t*c + t, b == t*d + t*f, c == t*s + t, d == t*s + t*a, f == t*c, e == t*d}; FullSimplify@First@Solve[eqs, {a, b, c, d, e, f, s}, Reals] // Column // TraditionalForm