0

I have the following system of ODE

eq1 = -s^2 ep[x] - cp''[x] + ep''[x] - θp''[x];
eq2 = A cp[x] - B cp''[x] + ep''[x] + C θp''[x];
eq3 = E cp[x] + F cp[x] + s ϵ ep[x] + G ep[x] + s θp[x] + K θp[x] - θp''[x];

A, B, C, E, F, G and K are constants. I need to eliminate both ep[x] and cp[x] from the equations so I solved eq1 and eq2 and got ep[x] and cp[x] by:

 Solve[eq1 == 0, cp[x]] // Simplify
 Solve[eq2 == 0, cp[x]] // Simplify  
 eq3 // Simplify

Then how I can eliminate cp[x] and ep[x] and their derivatives from eq3? Using the substituting /. rule will remove cp[x] and ep[x] but not their derivatives. I should obtain a 6th order differential equation of θp only.

xzczd
  • 65,995
  • 9
  • 163
  • 468
Essam
  • 77
  • 6
  • Do you get this error in a fresh Mathematica session? – J. M.'s missing motivation Dec 21 '16 at 01:16
  • Do not use E as a constant, because it is used in Mathematica as the base of natural logarithms. In general, it is a good idea not to begin symbols with capital letters. Finally, I do not obtain any errors when I run your code. – bbgodfrey Dec 21 '16 at 01:26
  • Thank you bbgodfrey. Most of the constants I used in the original file are in Greek letters. did you eliminate the functions cp[x] and ep[x] between eq1 and eq2? Did you got a six order differential equation in θp[x]?? – Essam Dec 21 '16 at 05:57
  • I just noticed you had done 2 rollbacks and discarded the format improvement by bbgodfrey, may I ask why? – xzczd Dec 23 '16 at 05:34

1 Answers1

2

This question is actually very similar to this one. It can be solved in the following way:

Eliminate[{eq1 == 0, D[eq1, x, x] == 0, eq2 == 0, D[eq2, x, x] == 0, eq3 == 0, 
   D[eq3, x, x] == 0, D[eq3, {x, 4}] == 0}, {cp[x], ep[x], cp''[x], ep''[x], cp''''[x], 
   ep''''[x]}] // Simplify

(*  (s^2 (C (E + F) + B (K + s)) + A (G + K + s (1 + s + ϵ))) 
       θp''[x] + (-1 + B) θp''''''[x] == 
   A s^2 (K + s) θp[x] + (A + E + C E + F + C F + B G + C G - K + B K - 
          s + B s + B s^2 + B s ϵ + C s ϵ) θp''''[x]  *)

We can also make use of the hidden syntax of Solve. (In many cases it performs better than Eliminate):

Equal @@@ First@
   Solve[{eq1 == 0, D[eq1, x, x] == 0, eq2 == 0, D[eq2, x, x] == 0, eq3 == 0, 
     D[eq3, x, x] == 0, D[eq3, {x, 4}] == 0}, θp[x], {cp[x], ep[x], cp''[x], 
     ep''[x], cp''''[x], ep''''[x]}] // Simplify
xzczd
  • 65,995
  • 9
  • 163
  • 468
  • Thank you xzczd. But the kernel hangs when I try the following: '

    eq1 = -s^2 ep[x] - (cp^[Prime][Prime])[x] + (ep^[Prime][Prime])[ x] - ([Theta]p^[Prime][Prime])[x]; eq2 = s [Alpha]2 (1 + s [Tau]) cp[x] - [Alpha]3 ( cp^[Prime][Prime])[x] + (ep^[Prime][Prime])[ x] + [Alpha]1 ([Theta]p^[Prime][Prime])[x]; eq3 = s [Alpha]1 [Epsilon] cp[x] + s^2 [Alpha]1 [Epsilon] [Tau]o cp[x] + s [Epsilon] ep[x] + s^2 [Tau]o ep[x] + s [Theta]p[x] + s^2 [Tau]o [Theta]p[x] - ([Theta]p^[Prime][Prime])[x];'

    – Essam Dec 23 '16 at 03:00
  • @Essam You need to use ` rather than ' to create code block in comment. As to the new question, check my edit. – xzczd Dec 23 '16 at 03:54
  • Grateful. it is working. Appreciate. But actually I don't know how to type code in comment. What you mean by "rather than". Thank you very much. – Essam Dec 23 '16 at 04:31
  • @Essam You've mistakenly used two quotation marks. (This is a quotation mark: ') The code should be between two backticks (This is a backtick: `, find it in the left-top corner of your keyboard). I've also used backtick when editing your question, if you still don't know how to use it, check how I edit your question. – xzczd Dec 23 '16 at 05:19
  • Like this code ep[x] -> (-s \[Alpha]2 cp[x] - s^2 \[Alpha]2 \[Tau] cp[x] - (cp^\[Prime]\[Prime])[ x] + \[Alpha]3 (cp^\[Prime]\[Prime])[ x] - (\[Theta]p^\[Prime]\[Prime])[ x] - \[Alpha]1 (\[Theta]p^\[Prime]\[Prime])[x])/s^2 – Essam Dec 23 '16 at 06:08
  • It is OK. Thank you now I know how to type a codes in comment because of your suggestion. Thanks a lot. – Essam Dec 23 '16 at 06:09
  • Hi xzczd. in tn the code Equal @@@ First@ Solve[{eq1 == 0, D[eq1, x, x] == 0, eq2 == 0, D[eq2, x, x] == 0, eq3 == 0, D[eq3, x, x] == 0, D[eq3, {x, 4}] == 0}, θp[x], {cp[x], ep[x], cp''[x], ep''[x], cp''''[x], ep''''[x]}] // SimplifyI don't understand the part D[eq3, {x, 4}] == 0} ?? Would you please explain it? – Essam Dec 23 '16 at 12:38
  • @essam If you mean the D[…, {x, 4}] part, it's equivalent to D[…, x, x, x, x]. For more information, check the document of D carefully. – xzczd Dec 23 '16 at 13:16
  • I have only 17 reputations. It is not enough to chat. – Essam Dec 23 '16 at 14:15
  • @Essam Then just ignore the warning and continue asking in the comment. Also, notice you can edit your comment within 5 minutes after it's posted. BTW, with all due respect, if you put more effort in asking good questions, you should have got enough reputation for chatting. – xzczd Dec 23 '16 at 14:29
  • Thanks xzczd. I tried the code without the part `Equal @@@ First@' and it gives the same result. What this part is used for? – Essam Dec 24 '16 at 00:59
  • @Essam Compare the 2 results carefully, their structures are different, one is a Rule, the other is an equation. For more information, check the document carefully, you may also be interested in this answer. BTW, if you still don't know how to use the document, check this answer. – xzczd Dec 24 '16 at 04:16
  • I tried to find the roots of the characteristic equation:Solve[-a3 + a2 k^2 - a1 k^4 + k^6 == 0, k, Real > 0] // FullSimplify . I need to remove or exclude those roots with negative real part. I got a warning message said that "Warning: Real>0 is not a valid domain specification. Assuming it is a variable to eliminate. >>" and another warning message: "Real>0 is not a valid variable. ". I tried to understand the warning but I didn't know how can I avoid these warning. How can we get the required roots? how can I interpret the condition that excludes the roots with negative real part – Essam Dec 26 '16 at 03:07
  • I used this but it gives some complex roots:Assuming[Reals > 0, Solve[a2 k^2 - a1 k^4 + k^6 == a3, k]] // FullSimplify??? – Essam Dec 26 '16 at 03:25
  • @Essam This is a completely new question, please post a new question rather than ask this in comment. – xzczd Dec 26 '16 at 05:15