# Petrov–Galerkin method

The Petrov–Galerkin method is a mathematical method used to approximate solutions of partial differential equations which contain terms with odd order and where the test function and solution function belong to different function spaces. It can be viewed as an extension of Bubnov-Galerkin method where the bases of test functions and solution functions are the same. In an operator formulation of the differential equation, Petrov–Galerkin method can be viewed as applying a projection that is not necessarily orthogonal, in contrast to Bubnov-Galerkin method.
It is named after the Soviet scientists Georgy I. Petrov and Boris G. Galerkin.

## Introduction with an abstract problem

Petrov-Galerkin's method is a natural extension of Galerkin method and can be similarly introduced as follows.

### A problem in weak formulation

Let us consider an abstract problem posed as a weak formulation on a pair of Hilbert spaces $V$ and $W$, namely,
    find $u\in V$ such that $a(u,w)=f(w)$ for all $w\in W$.
Here, $a(\cdot ,\cdot )$ is a bilinear form and $f$ is a bounded linear functional on $W$.

### Petrov-Galerkin dimension reduction

Choose subspaces $V_{n}\subset V$ of dimension n and $W_{m}\subset W$ of dimension m and solve the projected problem:
    Find $v_{n}\in V_{n}$ such that $a(v_{n},w_{m})=f(w_{m})$ for all $w_{m}\in W_{m}$.
We notice that the equation has remained unchanged and only the spaces have changed. Reducing the problem to a finite-dimensional vector subspace allows us to numerically compute $v_{n}$ as a finite linear combination of the basis vectors in $V_{n}$.

### Petrov-Galerkin generalized orthogonality

The key property of the Petrov-Galerkin approach is that the error is in some sense "orthogonal" to the chosen subspaces. Since $W_{m}\subset W$, we can use $w_{m}$ as a test vector in the original equation. Subtracting the two, we get the relation for the error, $\epsilon _{n}=v-v_{n}$ which is the error between the solution of the original problem, $v$, and the solution of the Galerkin equation, $v_{n}$, as follows
    $a(\epsilon _{n},w_{m})=a(v,w_{m})-a(v_{n},w_{m})=f(w_{m})-f(w_{m})=0$ for all $w_{m}\in W_{m}$.

### Matrix form

Since the aim of the approximation is producing a linear system of equations, we build its matrix form, which can be used to compute the solution algorithmically.
Let $v^{1},v^{2},\ldots ,v^{n}$ be a basis for $V_{n}$ and $w^{1},w^{2},\ldots ,w^{m}$ be a basis for $W_{m}$. Then, it is sufficient to use these in turn for testing the Galerkin equation, i.e.: find $v_{n}\in V_{n}$ such that
    $a(v_{n},w^{j})=f(w^{j})\quad j=1,\ldots ,m.$
We expand $v_{n}$ with respect to the solution basis, $v_{n}=\sum _{i=1}^{n}x^{i}v^{i}$ and insert it into the equation above, to obtain
    $a\left(\sum _{i=1}^{n}x^{i}v^{i},w^{j}\right)=\sum _{i=1}^{n}x^{i}a(v^{i},w^{j})=f(w^{j})\quad j=1,\ldots ,m.$
This previous equation is actually a linear system of equations $A^{T}x=f$, where
    $A_{ij}=a(v^{i},w^{j}),\quad f_{j}=f(w^{j}).$

#### Symmetry of the matrix

Due to the definition of the matrix entries, the matrix $A$ is symmetric if $V=W$, the bilinear form $a(\cdot ,\cdot )$ is symmetric, $n=m$, $V_{n}=W_{m}$, and $v^{i}=w^{j}$ for all $i=j=1,\ldots ,n=m.$ In contrast to the case of Bubnov-Galerkin method, the system matrix $A$ is not even square, if $n\neq m.$