# Symbolic system of partial differential equations - in Mathematica?

Posted 8 years ago
2523 Views
|
2 Replies
|
0 Total Likes
|
 Greetings all,I'm working with control systems and Lyapunov function candidates. Let's say we have a very basic system:dX/dt = X' = X*Y + 2XdY/dt = Y' = Y^2 + 3And I have a proposed Lyapunov function candidate of:V = X^2 + Y^2I would like to: Take an implicit time derivative of V (so as to get: dV/dt = V' = 2 * X * X' + 2 * Y * Y' ) Plugin my system of equations for X' and Y' (from above) into V' How can I do this in Mathematica?-RT
2 Replies
Sort By:
Posted 8 years ago
 I like to use little helper function called rhs, which returns the right hand side of an equation for these things. ClearAll[x, y, v, t, eq]; rhs[eq_] := eq /. (lhs_) == (rhs_) :> rhs; eq1 =x'[t] == x[t] y[t] + 2 x[t]; eq2 = y'[t] == y[t]^2 + 3; eq3 = v[t] == x[t]^2 + y[t]^2; eq4 = D[eq3, t]; which gives  v'[t] == 2 x[t] x'[t] + 2 y[t] y'[t] and now eq4 /. {x'[t] -> rhs[eq1], y'[t] -> rhs[eq2]} which returns  v'[t] == 2 x[t] (2 x[t] + x[t] y[t]) + 2 y[t] (3 + y[t]^2) 
Posted 8 years ago
 The equation for Y is easily solved In:= DSolve[Y'[t] == Y[t]^2 + 3, Y[t], t] Out= {{Y[t] -> Sqrt Tan[Sqrt t + Sqrt C]}} Determine C using the initial condition, say Y. Then solve DE for X. You can then evaluate V.