Documentation for Release 2024.1

# Equivalent Mono And Bidomain

This tutorial is automatically generated from TestEquivalentMonoAndBidomainTutorial.hpp at revision 1dfba06b4d82. Note that the code is given in full at the bottom of the page.

## How to run a Bidomain simulation and its equivalent Monodomain reduction

### Introduction

In this tutorial we show how Chaste is used to run a standard mono and a standard bidomain simulation. With equivalent parameters so that the bidomain could be reduced to the monodomain case.

The bulk of this tutorial is the same as the tutorial Running Bidomain Simulations, so for details of the following code block see that page.

The `HeartConfig`

class is used to set various parameters (see the main ChasteGuides page
for information on default parameter values.

See the Running Bidomain Simulations tutorial for more details.

This is how to reset the surface-area-to-volume ratio and the capacitance. (Here, we are actually just resetting them to their default values).

### Setting Bidomain Conductivities

Here we have conductivities that can be expressed as sigma_i = scalar * sigma_e.

Then this is a special case, in which the bidomain equations can be reduced to the monodomain equation. They are exactly equivalent.

In this test we check that Chaste says this too when doing both simulations.

This is how we set intracellular and extracellular conductivity directions. Note that the extracellular is a constant scaling (4x) of the intracellular, and hence a reduction to the monodomain equation can be made.

For more information on this see e.g. Keener & Sneyd, Mathematical Physiology textbook.

Initialise and solve as normal

NB: the easiest way to look at the resultant voltage values from the code
(for the last timestep - the data for the previous timesteps is written to file
but not retained) is to use a `ReplicatableVector`

.
`bidomain_problem.GetSolution())`

returns a PETSc vector
of the form (V_0, phi_0, V_1, phi_e_1, … V_n, phi_e_n), and we can create a
`ReplicatableVector`

for easy access to this PETSc vector’s data.
(This won’t be very efficient with huge problems in parallel - the next tutorial
will mention how to do parallel access).

### Reduction to Monodomain

We now work out the equivalent conductivity to use in the monodomain. Note that
we set this with the `SetIntracellularConductivities()`

method. Which is perhaps
better described as “Set first domain conductivities”.

So we calculate the equivalent conductivity according to (elementwise)

sigma_monodomain = sigma_i sigma_e / (sigma_i + sigma_e)

Now we create a monodomain problem class in exactly the same way as bidomain above

The bidomain solution includes extracellular (phi_e) so should be twice as big as monodomain solution.

We then check that the voltage at each node at the end of the simulation is the same whether we did a bidomain simulation, or the equivalent monodomain simulation.