Message Boards Message Boards

0
|
8424 Views
|
11 Replies
|
0 Total Likes
View groups...
Share
Share this post:

how to solve system of equations

Posted 9 years ago

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

POSTED BY: Massimo Galasi
11 Replies
Posted 9 years ago

Very thanks

POSTED BY: Massimo Galasi
Posted 9 years ago

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)
Attachments:
POSTED BY: David Keith
s -> (s /. generalSolution)
POSTED BY: Gianluca Gorni
Posted 9 years ago

Thanks for reply .. but I'd like to have this function:

enter image description here

POSTED BY: Massimo Galasi
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.

POSTED BY: Gianluca Gorni
Posted 9 years ago

Now .. How can I refer to the function s?

I want to print just this function..

Thanks!

POSTED BY: Massimo Galasi
Posted 9 years ago

Great!

POSTED BY: Massimo Galasi

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".

POSTED BY: Daniel Lichtblau
Posted 9 years ago

Sorry, ..anyway the request is solved!

Bye!

POSTED BY: Massimo Galasi

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

enter image description here

POSTED BY: Mariusz Iwaniuk

This may be what you want:

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]]

Strangely enough, this gives no answer:

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}, {a, b, c, d, e,
   f}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract