8
$\begingroup$

I have a system of ODEs.

$$ \begin{gathered} \frac{u_2-u_3}{R}=\frac{u_1}{R}+C \frac{\mathrm{~d} u_1}{\mathrm{~d} t} \\ C \frac{\mathrm{~d}}{\mathrm{~d} t}\left(u_3-u_1\right)=\frac{u_1}{R}+C \frac{\mathrm{~d} u_1}{\mathrm{~d} t} \\ u_2 = K u_1 \end{gathered} $$

I want to eliminate u1[t] and u3[t] to obtain a second-order ODE for u2[t].

$$R^2 C^2 \frac{\mathrm{~d}^2 u_2}{\mathrm{~d} t^2}+(3-K) R C \frac{\mathrm{~d} u_2}{\mathrm{~d} t}+u_2=0$$

I tried using Eliminate, but the result I got was True.

Clear["Global`*"]; eq1 = (u2[t] - u3[t])/r == u1[t]/r + c D[u1[t], t]; eq2 = c (D[u3[t], t] - D[u1[t], t]) == u1[t]/r + c D[u1[t], t]; eq3 = u2[t] == k u1[t]; result = Eliminate[{eq1, eq2, eq3}, {u1[t], Derivative[1][u1][t], u3[t], Derivative[1][u3][t]}] // Simplify (*True*) Clear["Global`*"]; eq1 = (u2[t] - u3[t])/r == u1[t]/r + c D[u1[t], t]; eq2 = c (D[u3[t], t] - D[u1[t], t]) == u1[t]/r + c D[u1[t], t]; eq3 = u2[t] == k u1[t]; eqs = {eq1, eq2, eq3}; eqs2 = Join[eqs, D[eqs, t]]; Eliminate[eqs2, {u1[t], u3[t], D[u1[t], t], D[u1[t], {t, 2}], D[u3[t], t], D[u3[t], {t, 2}]}] (*True*) 

My questions

  1. Why did I get True instead of a second-order ODE?

  2. Is there a general method to achieve this?

$\endgroup$
1
  • 3
    $\begingroup$ The first question is already answered in mathematica.stackexchange.com/a/76287/1871 Notice Eliminate cannot cleverly handle derivative term, it just handles u1[t] and D[u1[t], t] as two different variables. As to the second question, as shown by answers below, there exist methods with certain universality, but I don't think there exists a fully automatic method (at least for now), see also: mathematica.stackexchange.com/… $\endgroup$ Commented Jan 10 at 12:09

5 Answers 5

7
$\begingroup$

Just to support @UlrichNeumann answer (which I have voted for) but using built-in functions:

eq1 = (u2[t] - u3[t])/r == u1[t]/r + c D[u1[t], t]; eq2 = c (D[u3[t], t] - D[u1[t], t]) == u1[t]/r + c D[u1[t], t]; eq3 = u2[t] == k u1[t]; sys = LaplaceTransform[#, t, s] & /@ {eq1, eq2, eq3}; v = {LaplaceTransform[u1[t], t, s], LaplaceTransform[u2[t], t, s], LaplaceTransform[u3[t], t, s]}; de = InverseLaplaceTransform[Eliminate[sys, v[[{1, 3}]]], s, t] /. {u1[0] -> 0, u2[0] -> 0, u3[0] -> 0, u2'[0] -> 0}; dee = (-de[[1]] // Expand) == de[[2]]; Collect[dee, r c u2'[t]] 

->

u2[t] + c (3 - k) r Derivative[1][u2][t] + c^2 r^2 (u2^\[Prime]\[Prime])[t] == 0 

$c^2 r^2 \text{u2}''(t)+c (3-k) r \text{u2}'(t)+\text{u2}(t)=0$

$\endgroup$
1
  • $\begingroup$ This method is more general and automated. If the equation contains not only derivative terms but also integral terms, this code can also effectively achieve the goal. $\endgroup$ Commented Jan 15 at 14:12
13
$\begingroup$

To turn a diff. eqs. into alg. eqs., differentiate:

dorder = 2; (* total differential order *) u1order = 1;(* differential order of u1 *) u2order = 0; (* differential order of u2 *) u3order = 1; (* differential order of u3 *) deltaD = dorder - u2order; (* # D[...,t] *) Eliminate[ Flatten[NestList[D[#, t] &, eqn, deltaD]], Join[ NestList[D[#, t] &, u1[t], deltaD + u1order], NestList[D[#, t] &, u3[t], deltaD + u3order] ]] (* u2[t] + 3 c r u2'[t] - c k r u2'[t] + c^2 r^2 u2''[t] == 0 *) 

The OP's example is a linear system. Not sure if the above works on nonlinear DEs. Not sure what happens if the system cannot be reduced.

$\endgroup$
1
  • 2
    $\begingroup$ The gist of Cartan-Kuranishi, if I remember correctly, is that some variant of this will suffice if the problem is well-posed (meaning a solution exists). $\endgroup$ Commented Jan 10 at 18:38
9
$\begingroup$

Try Laplace transformation

eqn = {(u2[t] - u3[t])/r == u1[t]/r + c D[u1[t], t], c (D[u3[t], t] - D[u1[t], t]) == u1[t]/r + c D[u1[t], t], u2[t] == k u1[t]} eqn /. f_'[t] -> f[t] s (Eliminate[%, {u1[t], u3[t]}] // Expand) /. {s u2[t] -> u2'[t],s^2 u2[t] -> u2''[t]} (*-(u2[t]/r) - 3 c Derivative[1][u2][t] + c k Derivative[1][u2][t] - c^2 r (u2^\[Prime]\[Prime])[t] == 0 && r != 0*) 
$\endgroup$
7
$\begingroup$
Clear["Global`*"]; eq1 = (u2[t] - u3[t])/r == u1[t]/r + c D[u1[t], t]; eq2 = c (D[u3[t], t] - D[u1[t], t]) == u1[t]/r + c D[u1[t], t]; eq3 = u2[t] == k u1[t]; eq1a = D[eq1, t]; s1 = Solve[eq3, u1[t]]; s2 = D[s1, t]; s3 = D[s2, t]; result = Assuming[{r, c, k} ∈ PositiveReals, Eliminate[{eq1, eq2, eq1a}, {u3[t], u3'[t]}] /. s1 /. s2 /. s3 // Simplify ] // #[[1, 1, 1]] & 

result


  1. This is an example of using an advanced CAD tool like a paper and a pencil.

  2. I don't know of a general technique. Any implicit dependence would render it useless.

$\endgroup$
2
  • $\begingroup$ @xzczd, Thanks for the edit. I have lost the extra edit buttons extension on my browser. It is there, but I can't activate it. If you know of a workaround to restore it, please let me know. I am using Chrome on Win7-x64. $\endgroup$ Commented Jan 10 at 12:14
  • $\begingroup$ I'm using Domen's fix with tampermonkey :) . $\endgroup$ Commented Jan 10 at 12:18
0
$\begingroup$

The last equation can be used to eliminate u2:

des[t_] = {(u2[t] - u3[t])/r == u1[t]/r + c u1'[t], c (u3'[t] - u1'[t]) == u1[t]/r + c u1'[t]} /. u1 :> (t |-> u2[t]/k); 

Then we can directly eliminate u3 and its derivatives:

Eliminate[Flatten@{des[t], des'[t]}, {u3[t], u3'[t], u3''[t]}] 

to obtain the form you require.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.