# 6. Algebraic proxy#

## 6.1. Matrix proxy#

With the fully discrete weak formulation `wf`, we can bring it into its algebraic proxy by calling its method `mp`, standing for matrix proxy,

```>>> mp = wf.mp()
```

which is an instance of `MatrixProxy`,

class MatrixProxy(wf)[source]#
ls()[source]#

Convert self to an abstract linear system.

Returns:
ls`MatrixProxyLinearSystem`

The linear system instance.

nls()[source]#

Convert self to an abstract nonlinear system.

Returns:
nls`MatrixProxyNoneLinearSystem`

The nonlinear system instance.

pr(figsize=(12, 8))[source]#

Print the representation, a figure, of this weak formulation.

Parameters:
figsizetuple, optional

The figure size. It has no effect when the figure is over-sized. A tight configuration will be applied when it is the case. The default value is `(12, 8)`.

Similarly, its `pr` method can illustrate it properly,

```>>> mp.pr()
<Figure size ...
```

## 6.2. Algebraic representation#

Depend on `mp` is linear or nonlinear, an algebraic system can be produced through either method `ls` or `nls` of `mp`, see `MatrixProxy.ls()` and `MatrixProxy.nls()`.

Method `ls` gives an instance of `MatrixProxyLinearSystem`, i.e.,

class MatrixProxyLinearSystem(mp, ls, mp_bc)[source]#

And method `nls` leads to an instance of `MatrixProxyNoneLinearSystem`, namely,

class MatrixProxyNoneLinearSystem(mp, mp_ls, nls)[source]#

In this case, `mp` is a linear system. Thus, we should call `ls` method of it,

```>>> ls = mp.ls()
>>> ls.pr()
<Figure size ...
```

Eventually, a fully discrete abstract linear system is obtained. We can send it a particular implementation which will objectivize it, for example by making matrices 2-dimensional arrays and making the vectors 1-dimensional arrays. These implementations will be introduced in the following section.

↩️ Back to Documentations.