0
$\begingroup$

I have the following system of equations that describes the interaction between individuals (4 different types giving rise to 16 different types of interactions). K is a variable and I'm not using "K" exactly (I'm using a greek letter) so that shouldn't be the issue. For some reason, Mathematica is saying:

DSolve::deqx: Supplied equations are not differential equations of
the given functions.

DSolve[{HB'[
t] == -HB[t] (HB[t] + K Hb[t] + hB[t] + K hb[t]), 
Hb'[t] == -Hb[t] (HB[t] + K Hb[t] + hB[t] + K hb[t]), 
hB'[t] == -hB[t] (HB[t] + Hb[t] + hB[t] + hb[t]), 
hb'[t] == -hb[t] (HB[t] + Hb[t] + hB[t] + hb[t]), 
HBHB'[t] == HB[t] HB[t], HBHb'[t] == HB[t] Hb[t], 
HBhB'[t] == HB[t] hB[t], HBhb'[t] == HB[t] hb[t], 
HbHB'[t] == Hb[t] HB[t], HbHb'[t] == Hb[t] Hb[t], 
HbhB'[t] == Hb[t] hB[t], Hbhb'[t] == Hb[t] hb[t], 
hBHB'[t] == hB[t] HB[t], hBHb'[t] == hB[t] Hb[t], 
hBhB'[t] == hB[t] hB[t], hBhb'[t] == HB[t] hb[t], 
hbHB'[t] == hb[t] HB[t], hbHb'[t] == hb[t] Hb[t], 
hbhB'[t] == hb[t] hB[t], hbhb'[t] == HB[t] hb[t], HB[0] == HB0, 
Hb[0] == Hb0, hB[0] == hB0, hb[0] == hb0, HBHB[0] == 0, 
HBHb[0] == 0, HBhB[0] == 0, HBhb[0] == 0, HbHB[0] == 0, 
HbHb[0] == 0, HbhB[0] == 0, Hbhb[0] == 0, hBHB[0] == 0, 
hBHb[0] == 0, hBhB[0] == 0, hBhb[0] == 0, hbHB[0] == 0, 
hbHb[0] == 0, hbhB[0] == 0, hbhb[0] == 0}, {HBHB[t], HBHb[t], 
HBhB[t], HBhb[t], HbHB[t], HbHb[t], HbhB[t], Hbhb[t], hBHB[t], 
hBHb[t], hBhB[t], hBhb[t], hbHB[t], hbHb[t], hbhB[t], hbhb[t]}, t]

Being the first time using DSolve, I have no idea why this is happening. Can someone shed some light on this?

$\endgroup$
3
$\begingroup$

DSolve::deqx: Supplied equations are not differential equations of the given functions.

As for as the error is concern, you need to state all the dependent variables (call all the dependent variables in DSolve).

Once we did that, DSolve is unable to solve the system. It seems that the system in question has no analytical solution. So, I tried with NDSolve,

eq1 = HB'[t] == -HB[t] (HB[t] + K1 Hb[t] + hB[t] + K1 hb[t]);    
eq2 = Hb'[t] == -Hb[t] (HB[t] + K1 Hb[t] + hB[t] + K1 hb[t]);    
eq3 = hB'[t] == -hB[t] (HB[t] + Hb[t] + hB[t] + hb[t]);    
eq4 = hb'[t] == -hb[t] (HB[t] + Hb[t] + hB[t] + hb[t]);    
eq5 = HBHB'[t] == HB[t] HB[t];    
eq6 = HBHb'[t] == HB[t] Hb[t];    
eq7 = HBhB'[t] == HB[t] hB[t];    
eq8 = HBhb'[t] == HB[t] hb[t];    
eq9 = HbHB'[t] == Hb[t] HB[t];    
eq10 = HbHb'[t] == Hb[t] Hb[t];    
eq11 = HbhB'[t] == Hb[t] hB[t];    
eq12 = Hbhb'[t] == Hb[t] hb[t];    
eq13 = hBHB'[t] == hB[t] HB[t];    
eq14 = hBHb'[t] == hB[t] Hb[t];    
eq15 = hBhB'[t] == hB[t] hB[t];    
eq16 = hBhb'[t] == HB[t] hb[t];    
eq17 = hbHB'[t] == hb[t] HB[t];    
eq18 = hbHb'[t] == hb[t] Hb[t];    
eq19 = hbhB'[t] == hb[t] hB[t];    
eq20 = hbhb'[t] == HB[t] hb[t];

Choosing random values for the parameters

HB0 = 1; Hb0 = 1; hB0 = 1; hb0 = 1; K1 = 1;

sol=NDSolve[{eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10, eq11, eq12,
   eq13, eq14, eq15, eq16, eq17, eq18, eq19, eq20, HB[0] == HB0, 
  Hb[0] == Hb0, hB[0] == hB0, hb[0] == hb0, HBHB[0] == 0, 
  HBHb[0] == 0, HBhB[0] == 0, HBhb[0] == 0, HbHB[0] == 0, 
  HbHb[0] == 0, HbhB[0] == 0, Hbhb[0] == 0, hBHB[0] == 0, 
  hBHb[0] == 0, hBhB[0] == 0, hBhb[0] == 0, hbHB[0] == 0, 
  hbHb[0] == 0, hbhB[0] == 0, hbhb[0] == 0}, {HB[t], Hb[t] , hB[t], 
  hb[t], HBHB[t], HBHb[t], HBhB[t], HBhb[t], HbHB[t], HbHb[t], 
  HbhB[t], Hbhb[t], hBHB[t], hBHb[t], hBhB[t], hBhb[t], hbHB[t], 
  hbHb[t], hbhB[t], hbhb[t]}, {t,0,10}];

Plot[Evaluate[{HB[t], Hb[t] , hB[t], hb[t], HBHB[t], HBHb[t], HBhB[t],
     HBhb[t], HbHB[t], HbHb[t], HbhB[t], Hbhb[t], hBHB[t], hBHb[t], 
    hBhB[t], hBhb[t], hbHB[t], hbHb[t], hbhB[t], hbhb[t]} /. sol], {t, 0, 10}]

enter image description here

$\endgroup$
4
  • $\begingroup$ Thanks :) I think that's the issue indeed. But is it normal for Mathematica to do this? Obviously, there was something wrong in the code but, when I correct for that (using DSolve), Mathematica simply doesn't do anything, repeating my input in the output. Is that normal? $\endgroup$ – GWasp Mar 15 '17 at 20:04
  • $\begingroup$ @GonçaloFaria It all depends on equations in question. $\endgroup$ – zhk Mar 16 '17 at 6:42
  • 1
    $\begingroup$ Is there anyway to get an analytical answer out of this? Although NDSolve provides a nice answer, it's only a numerical answer and I'm interested in an analytical answer.. For instance, I know that K1 needs to be between 0 and 1.. I don't know if that helps. $\endgroup$ – GWasp Mar 17 '17 at 11:25
  • $\begingroup$ @GonçaloFaria I already answered your question. Didn't I? $\endgroup$ – zhk Mar 18 '17 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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