Message Boards Message Boards

0
|
2798 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Symbolic system of partial differential equations - in Mathematica?

Posted 9 years ago

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 + 2X

dY/dt = Y' = Y^2 + 3

And I have a proposed Lyapunov function candidate of:

V = X^2 + Y^2

I would like to:

  1. Take an implicit time derivative of V (so as to get: dV/dt = V' = 2 * X * X' + 2 * Y * Y' )

  2. Plugin my system of equations for X' and Y' (from above) into V'

How can I do this in Mathematica?

-RT

POSTED BY: Richard Tarbell
2 Replies

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 BY: Nasser M. Abbasi

The equation for Y is easily solved

In[36]:= DSolve[Y'[t] == Y[t]^2 + 3, Y[t], t]

Out[36]= {{Y[t] -> Sqrt[3] Tan[Sqrt[3] t + Sqrt[3] C[1]]}}

Determine C[1] using the initial condition, say Y[0]. Then solve DE for X. You can then evaluate V.

POSTED BY: S M Blinder
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