Group Abstract Group Abstract

Message Boards Message Boards

[?] Solve symbolic system of differential and algebric equations?

Posted 9 years ago

Hello everyone, I tried to solve a symbolic system of differential and algebric equations between (0,x) with the following code:

DSolve[{(Qd Cd)'[x] == kd (Ci[x] - Cd[x]), (Qd)'[x] == 
   ko (Cd[x] - Ci[x]), Qa (Ca)'[x] == ka Ca[x], 
  ka Ca[x] == kd (Ci[x] - Cd[x])}, {Qd, Cd, Ca}, x]

where Qa, ko, ka, kd are positive constants. The code does not work. I expect the solution:

enter image description here

Thank you very much for your time.

Attachments:
POSTED BY: Gennaro Arguzzi
7 Replies

Gennaro,

you have multiple issues going on here. You have 4 things that vary in x but only include 3 in the list of variables. I do not understand what this means (Qd Cd)'[x]. It cannot be correct. I would not put parens around (Ca)'[x] although syntactically its ok.

I changed your equations and this solves but I am not sure what your original equations should be:

DSolve[{Derivative[1][Cd][x] == kd (-Cd[x] + Ci[x]), 
  Derivative[1][Qd][x] == ko (Cd[x] - Ci[x]), 
  Qa Derivative[1][Ca][x] == ka Ca[x], 
  ka Ca[x] == kd (-Cd[x] + Ci[x])}, {Qd[x], Cd[x], Ca[x], Ci[x]}, x]

I hope this helps.

Regards,

Neil

POSTED BY: Neil Singer

Very good, Gianluca --

As I said, Gennaro, they are DAE's and needed manipulation... :)

POSTED BY: Neil Singer

@Neil Singer see the attachment please. There is the step-by-step solution.

POSTED BY: Gennaro Arguzzi

Hello @Gianluca Gorni , why in the solution occur an integral? I attach the step-by-step solution.

Cd[x] -> C[3] + 
  Integrate[((
   E^((ka K[1])/Qa)
     ka C[1] (-kd^2 + E^((ka K[1])/Qa) ka ko C[1] - kd ko Ci[K[1]]))/(
   kd (E^((ka K[1])/Qa) ko Qa C[1] - kd C[2])))
POSTED BY: Gennaro Arguzzi
POSTED BY: Neil Singer

Your last equation is algebraic, not differential. You can solve it for Cd[x] and replace in the other equations:

eq0 = {D[Qd[x]*Cd[x], x] == kd (-Cd[x] + Ci[x]), 
   Qd'[x] == ko (Cd[x] - Ci[x]), Qa Ca'[x] == ka Ca[x], 
   ka Ca[x] == kd (-Cd[x] + Ci[x])};
eq1 = Most[eq0] /. Solve[Last[eq0], Cd[x]][[1]];
eq3 = Solve[eq1, D[{Qd[x], Ca[x], Cd[x]}, x]][[1]] /. Rule -> Equal;
DSolve[eq3, {Qd[x], Ca[x], Cd[x]}, x]
POSTED BY: Gianluca Gorni

Hello @Neil Singer , the term (Qd Cd)'[x] means d(Qc Cd) /dx. I tried to correct the code, but maybe my syntax is wrong:

DSolve[{Derivative[1][Qd Cd][x] == kd (-Cd[x] + Ci[x]), 
  Derivative[1][Qd][x] == ko (Cd[x] - Ci[x]), 
  Qa Derivative[1][Ca][x] == ka Ca[x], 
  ka Ca[x] == kd (-Cd[x] + Ci[x])}, {Qd[x], Cd[x], Ca[x], Ci[x]}, x]

and with:

DSolve[{D[Qd[x] Cd[x], x] == kd (-Cd[x] + Ci[x]), 
  Derivative[1][Qd][x] == ko (Cd[x] - Ci[x]), 
  Qa Derivative[1][Ca][x] == ka Ca[x], 
  ka Ca[x] == kd (-Cd[x] + Ci[x])}, {Qd[x], Cd[x], Ca[x], Ci[x]}, x]

Thank you so much.

POSTED BY: Gennaro Arguzzi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard