0
$\begingroup$

Just having a total blank at the moment, I realise that maybe this question would best be suited for a math forum but i assume Mathematica is needed in order to solve these equations. So the question explains that as time passes the two equations "decay", just no idea by how much. So basically there are two ordinary, differential equations both decaying at different rates (I've attached them). I need to solve them for $t = 0$ to $120$ minutes.

Assume the initial conditions at $t = 0$ are

$\quad \quad A=B=0$

and that the parameters are

$\quad \quad K_1=0.5,\, K_2=2,\, n=10$

The ODEs are

$$\frac{dA}{dt}=\frac{0.5}{1+\left(\frac{B}{K_1}\right)^n}-0.2\,A$$ $$\frac{dB}{dt}=\frac{1}{1+\left(\frac{A}{K_2}\right)^n}-2\,B$$

I really have no idea mathematically nor Mathematica-wise on how to do this :(

$\endgroup$

closed as off-topic by bbgodfrey, Oleksandr R., chris, m_goldberg, Dr. belisarius May 25 '15 at 20:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – bbgodfrey, Oleksandr R., chris, m_goldberg, Dr. belisarius
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Look at DSolve & NDSolve $\endgroup$ – Sektor May 25 '15 at 15:47
  • $\begingroup$ Thanks, might sound stupid but I am still unsure of the relationship between t and both equations, is it that each value of A or B is affected by the amount calculated in the equation per 1 minute interval of t? $\endgroup$ – Steve May 25 '15 at 15:55
2
$\begingroup$

You could try something like this (but this question is likely to be closed because it has been asked 10 000 times)

eqn1 = D[A[t], t] == 1/2/(1 + (B[t]/k1)^n) - 2/10 A[t]
eqn2 = D[B[t], t] == 1/(1 + (A[t]/k2)^n) - 2 B[t]

You can then solve for A[t],B[t]

sol=NDSolveValue[{eqn1, eqn2, A[0] == 0, B[0] == 0} /. {n -> 10, k1 -> 1/2, 
   k2 -> 2}, {A[t], B[t]}, {t, 0, 1}]

Mathematica graphics

Then you can plot the result:

Plot[sol, {t, 0, 1}]

Mathematica graphics

$\endgroup$
  • $\begingroup$ "... I have assumed arbitrarily that n=1,k1=k2=1 and A[0]=0, B[0]=0." doesn't seem to be the case. It appears that you substituted the OP values for the parameters. And the OP specified A[0]=0, B[0]=0. You should reconsider that remark. $\endgroup$ – m_goldberg May 25 '15 at 16:54
  • $\begingroup$ No intent of telling you off. Just suggesting that you edit your answer to reflect the current state of the question. $\endgroup$ – m_goldberg May 25 '15 at 17:06
1
$\begingroup$

Without understanding what is happening conceptually, I'm afraid that Mathematica probably won't help you much. You have a 2-by-2 system of differential equations, which I would recommend researching in general.

However, I like using Mathematica to visualize what is happening in a system, so here's some code!

k1 = 0.5; k2 = 2; n = 10;
StreamPlot[{.5/(1 + (y/k1)^n) - 0.2*x, 1/(1 + ((x/k2)^n) ) - 2*y}, 
  {x, -7, 7}, {y, -7, 7}]

Direction Field

I changed the notation to $x$ and $y$ instead of $A$ and $B$, but it's the same equations. This is a plot of the system's evolution over time for various initial conditions. I don't know where these equations came from, but this type of visualization helped me when I took Diff EQ's.

For some background info, try this

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.