Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.6K Views
|
7 Replies
|
2 Total Likes
View groups...
Share
Share this post:

[?] Display system of 4 equations dependent on time and each other?

Posted 8 years ago

Hi everyone,

I do not have much experience with Mathematica and I am hoping to use it to display a system of four equations, where I can set and change the starting values and visualize how the system always reaches equilibrium. I've taken advanced math courses but it has been a while since I've tried to do something like this. I think I've been able to come up with the correct equations, but I'm struggling to find a way to visualize them. Can you help?

My code is below. I added in spaces for ease of reading. I also attached them as a Wolfram file.

Plot [ {A (x >= 1) == ((G (x - 1))/25) - ((A (x - 1))/25) + 
    A (x - 1),

  G (x >= 1) == ((T (x - 1))/25) - ((A (x - 1))/50) + ((G (x - 1))/
      50) + G (x - 1),

  T (x >= 1) == ((A (x - 1))/25) - ((A (x - 1))/75) + ((G (x - 1))/
      75) + ((T (x - 1))/75) + T (x - 1),

  Y (x >= 1) == ((A (x - 1))/25) - ((A (x - 1))/75) + ((G (x - 1))/
      75) + ((T (x - 1))/75) + Y (x - 1),

  A (x < 1) == 30,

  G (x < 1) == 20,

  T (x < 1) == 15,

  Y (x < 1) == 35},

 {x, 0, 100}
 ]
Attachments:
POSTED BY: Jeff Powell
7 Replies
Posted 8 years ago
POSTED BY: Bill Simpson
Posted 8 years ago
Attachments:
POSTED BY: Jeff Powell
Posted 8 years ago
POSTED BY: Bill Simpson
Posted 8 years ago
POSTED BY: Jeff Powell
Posted 8 years ago
POSTED BY: Bill Simpson
Posted 8 years ago

Thanks for the help, Bill! I'm using this for a class presentation and, though it's not "perfect", I've gotten it to point that I need to get it to for the sake of getting my point across.

POSTED BY: Jeff Powell
Posted 8 years ago

Also, can you help me understand why I'm able to evaluate the first code below, but not the second (which has a square thrown in?)

Clear[A, G, T, Y, x];
f = {A[x], G[x], T[x], Y[x]} /. RSolve[{
     A[x] == (G[x - 1]/25) - (A[x - 1]/25) + A[x - 1],
     A[0] == 35,
     G[x] == (T[x - 1]/25) - (G[x - 1]/25) + G[x - 1],
     G[0] == 30,
     T[x] == (Y[x - 1]/25) - (T[x - 1]/25) + T[x - 1],
     T[0] == 20,
     Y[x] == (A[x - 1]/25) - (Y[x - 1]/25) + Y[x - 1],
     Y[0] == 15},
    {A[x], G[x], T[x], Y[x]}, x];
g2 = Plot[f, {x, 0, 100}, PlotRange -> Full]

Here's the second code:

Clear[A, G, T, Y, x];
f = {A[x], G[x], T[x], Y[x]} /. RSolve[{
     A[x] == (G[x - 1]/25) - (A[x - 1]/25)^2 + A[x - 1],
     A[0] == 35,
     G[x] == (T[x - 1]/25) - (G[x - 1]/25)^2 + G[x - 1],
     G[0] == 30,
     T[x] == (Y[x - 1]/25) - (T[x - 1]/25)^2 + T[x - 1],
     T[0] == 20,
     Y[x] == (A[x - 1]/25) - (Y[x - 1]/25)^2 + Y[x - 1],
     Y[0] == 15},
    {A[x], G[x], T[x], Y[x]}, x];
g2 = Plot[f, {x, 0, 100}, PlotRange -> Full]
POSTED BY: Jeff Powell
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard