Message Boards Message Boards

Symbolically solve a system of first order differential algebraic equations

Posted 6 years ago

Hi, I am new to mathematica, never used it before. I have a DAE problem, since its my first time am struggling to debug the issue. My problem contain a set of equations both algebraic and differential equation where to find the differential unknown. I need to manipulate the algebraic equation and substitute one of the existed algebraic unknown in the differential equation so that to keep equation only contain one differential unknown.

If this is done manually, after substitution will end up with second order differential equation and makes it difficult to solve by hand. So, I want to solve it symbollically in mathematica. I have attached the file and photo contating the equation and the variables of interest. Please kindly some one help me to figure this out and find the solution.enter image description here

Attachments:
POSTED BY: Gurudeep D
4 Replies

Below is verbatim your system. Copy it and paste it into a cell and run it.

eqns = {-b[t]*kr + vc[t] + d2 - b'[t]*kl == 0, bc[t] + c1*vc'[t] == 0,
   vl[t] - kr*b[t] + kl*b'[t] == 0, vc[t] - d2 - vl[t] == 0, 
  vin - q1*2*b[t] - d1 - vl[t] - q2*b[t] == 0, b[t] + bc[t] == 0}

Next copy and paste the following instruction into the next cell and run it as before.

Reduce[eqns, {b[t], vc[t], vc'[t], b'[t]}]

The output allows you to solve your problem by considering 5 cases. In each case, determine b and vc and substitute them back into eqns to find out whether there are additional constraints.

I hope that the above suggestions will help.

POSTED BY: Ta'a Nwa Dombou

Assuming I transcribed correctly, your b[t] and vc[t] are both constant.

diffpolys = {-b[t]*kr + vc[t] + d2 - b'[t]*kl, bc[t] + c1*vc'[t], 
   vl[t] - kr*b[t] + kl*b'[t], vc[t] - d2 - vl[t], 
   vin - q1*2*b[t] - d1 - vl[t] - q2*b[t], b[t] + bc[t]};
gb = GroebnerBasis[
  diffpolys, { Derivative[1][b][t], Derivative[1][vc][t], b[t], 
   vc[t]}, {bc[t], vl[t]}]

(* Out[165]= {d1 kr - d2 kr - kr vin + kr vc[t] + 2 q1 vc[t] + q2 vc[t], 
 d1 - d2 - vin + 2 q1 b[t] + q2 b[t] + vc[t], 
 kr b[t] - vc[t], -b[t] + c1 Derivative[1][vc][t], -d2 + 
  kl Derivative[1][b][t]} *)

The first element in that result shows vc[t] can be solved for in terms of the constant parameters. The second one then shows b[t] can be solved in terms of vc[t].

POSTED BY: Daniel Lichtblau

Your system is indeed overdetermined. One thing you can do is to solve the first four equations and then replace into the remaining two, to get the compatibility conditions:

sol = DSolve[eqns[[{1, 2, 3, 4}]], {b, vc, bc, vl}, t] // First
compatibility = Solve[eqns[[{5, 6}]] /. sol]
POSTED BY: Gianluca Gorni
Posted 6 years ago

Hey,

Thank you for the response.

But, here I am only interested in to find out the term vc[t] and b[t] and as I did it manually the expected solution is in the form of = e^at[C1cos(bt)+C2sin(bt)]-d2. Where, a = kr/2klc1 and b = sqrt(kl^2c1^2-4krc1/2klc1). How do it get it in that cos and sin or in exponential format.

{b -> Function[{t}, (d2 t)/kl + C[1]], 
 bc -> Function[{t}, -((c1 d2 kr)/kl)], 
 vc -> Function[{t}, kr ((d2 t)/kl + C[1])], 
 vl -> Function[{t}, -d2 + kr ((d2 t)/kl + C[1])]}

{c1 -> (d2 t + kl C[1])/(d2 kr), 
  vin -> (d1 kl - d2 kl + d2 kr t + 2 d2 q1 t + d2 q2 t + 
    kl kr C[1] + 2 kl q1 C[1] + kl q2 C[1])/kl}, {d2 -> 0, vin -> d1, 
  C[1] -> 0}, {kr -> 0, vin -> d1 - d2, 
  C[1] -> -((d2 t)/kl)}, {kr -> 0, t -> 0, vin -> d1 - d2, C[1] -> 0}}

This is the result I got whenI followed your instruction it could not follow it.

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

Group Abstract Group Abstract