# How to Solve a Differential Equation System Depending on Variable Solved in an Implicit Function?

I have an ordinary differential equation system need to be solved by using Mathematica.

$$\frac{dk(t)}{dt}=((1-\kappa(t))k(t))^{\alpha}(1-\frac{\kappa(t)}{\kappa(t)+\frac{1-\alpha}{\alpha}\frac{\eta}{\beta}(1-\kappa(t))})^{1-\alpha}-(\delta+v-\gamma_2)k(t)-\lambda(t)^{-1}(1+ \omega q^{1-\epsilon})^{-1}-\omega q^{1-\epsilon}\lambda(t)^{-1}(1+ \omega q^{1-\epsilon})^{-1}-\frac{q}{z}(\kappa(t) k(t))^{\eta}\frac{\kappa(t)}{\kappa(t)+\frac{1-\alpha}{\alpha}\frac{\eta}{\beta}(1-\kappa(t))}^{\beta}+\frac{q}{A_2}c_1$$

$$\frac{d\lambda(t)}{dt}=\lambda(t)((\rho+\delta+\gamma)-\alpha((1-\kappa(t))k(t))^\alpha(1-\frac{\kappa(t)}{\kappa(t)+\frac{1-\alpha}{\alpha}\frac{\eta}{\beta}(1-\kappa(t))})^{1-\alpha})$$

$$F(k(t),\kappa(t))=(\frac{\alpha}{\eta})^{\alpha}(\frac{1-\alpha}{\beta})^{1-\alpha}(\kappa(t)k(t))^{\alpha-\eta}(\frac{\kappa(t)}{\kappa(t)+\frac{1-\alpha}{\alpha}\frac{\eta}{\beta}(1-\kappa(t))})^{1-\alpha-\beta} - \frac{q}{z}=0$$

The ODE system is about $$k(t)$$ and $$\lambda(t)$$ , and $$\kappa(t)$$ is the function of $$k(t)$$. However, I cannot explicit write $$\kappa(t)$$ as the function of $$k(t)$$.

I only know that I can use NDSolve to get the numerical solution of the ODE system, but how to combine this implicit $$\kappa(t)$$ function into the ODE system and get the solution?

The following is the code I wrote:

kt=-276.182*Exp[-5.7*t] + 3.1*k[t] - 1/lambda[t] + (4.79348*Exp[-1.76*t]*kappa[t]*(k[t]*kappa[t])^0.1)/(0.683673 + kappa[t]) + ((0.683673 - 0.683673*kappa[t])/(0.683673 + kappa[t]))^0.67*(k[t] - k[t]*kappa[t])^0.33 - k'[t]
lambdat=lambda[t]*(4.45 - 0.33*(k[t]*(1 - kappa[t]))^0.33*(1-kappa[t]/(0.406061*(1-kappa[t]) + kappa[t]))^0.67) - lambda'[t]
ft=2.84703*Exp[-1.76*t] + 1.80414*(k[t]*kappa[t])^0.23 *(kappa[t]/(0.406061*(1 - kappa[t]) + kappa[t]))^0.17==0

eqns = {kt == 0, lambdat == 0, k == 0.03, lambda == 6};
soln = NDSolve[eqns, {k, lambda}, {t, 0, 5}]


The code is only about the ODE equation system and doesn't include the implicit function $$\kappa(t)$$.

• What is ft in your code? Should be included in the number of equations ft = 0? – Alex Trounev May 7 at 23:19
• Correct typos e^(-5.7*t)  should be E^(-5.7*t)  and e^(-1.76*t) should be E^(-1.76*t) – Alex Trounev May 7 at 23:35
• @AlexTrounev sorry many typos, I will correct them. Thank you! – YoYo May 8 at 0:11
• Equation ft==0 has no real solutions. – Alex Trounev May 8 at 10:50
• Here's an example that incorporates an implicitly defined x[t]. Hope it helps. I don't have time right now to look into and answer your specific problem. -- F[x_, y_] := x + x^3 - y - 8 y^3; sol = First@ NDSolve[{y'[t] == x[t], F[x[t], y[t]] == 2, x == 1, y == 0}, {y, x}, {t, 0, 1}] – Michael E2 May 8 at 12:58