3
$\begingroup$

I have the equation

$F(t) = \phi u + \frac{1}{2}\frac{d^2u}{dt^2} + u^3$

and broadly speaking, my task is to calculate the $\phi$ and $u(t)$ such that $F(t) = 0$.

I am testing out a new algorithm to do this (and so there are no in-built ways to implement it). This requires calculating the Jacobian of the function.

I am implementing this on MATLAB.

I am unable to figure out how exactly I take the partial derivative with $u$ for the term with the derivative.

Here's what I have done so far -

Assuming $\textbf{u}_3$ is the row vector form of $u$ which has been cubed elementwise, I calculated the Jacobian as -

$\textbf{J} = \phi\textbf{I} + \textbf{D} + \textbf{u}_3\textbf{I}$

where D is the appropriate finite difference matrix and I is the identity matrix.

My first question is - is this correct?

If yes, my second question is, can the same thing be done for a different differentiation technique (like spectral differentiation) by simply replacing D by the appropriate matrix?

$\endgroup$
3
$\begingroup$

There are some unknowns in what you are doing but for simplicity, suppose we want to find $u(t)$ as discrete times $t_1, t_2, \cdots, t_n$. Let $\textbf{F} = [F(t_1), F(t_2), \cdots, F(t_n)]^T$ and $\textbf{u} = [u(t_1), u(t_2), \cdots, u(t_n)]^T$ be column vectors representing $F$ and $u$ evaluated at the desired times. From your problem statement, you wish to find $\phi$ and $\textbf{u}$ such that $\textbf{F} = \textbf{0}$. We can write out the vector equation as

\begin{align} \textbf{F} &= \underbrace{(\phi I + D)}_{A}\textbf{u} + \left(\textbf{u} \odot \textbf{u} \odot \textbf{u}\right) \end{align}

where $D$ is your appropriate finite difference matrix and $\odot$ corresponds to the Hadamard product. The jacobian you are after is going to have partial derivatives of the form $\frac{\partial F_i}{ \partial u_j}$, where $F_i = F(t_i)$ and $u_j = u(t_j)$. We can look at the above vector system elementwise and see that for a fixed $i$, we have that

$$F_i = u_i^3 + \sum_{j} A_{ij} u_j$$

If you take the partial derivative of $F_i$ with respect to some $u_k$, you get that \begin{align} \frac{\partial F_i}{\partial u_k} &= \frac{\partial}{\partial u_k} \left\lbrace u_i^3 + \sum_j A_{ij} u_j \right\rbrace \\ &= 3 \delta_{ik} u_i^2 + A_{ik} \end{align}

where $\delta_{ij} = 1$ if $i = j$ and is $0$ otherwise. This implies that your jacobian portion $J = [\frac{\partial F_i}{\partial u_k}]$ (where $i$ corresponds to rows and $k$ to columns) has the matrix form of

$$J = A + 3 \text{diag}\left(\textbf{u} \odot \textbf{u}\right)$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.