-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctionConstructor.py
More file actions
41 lines (28 loc) · 994 Bytes
/
FunctionConstructor.py
File metadata and controls
41 lines (28 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import numpy as np
def Constructor(v,a):
'''Function which constructs the righthand side of the FitzHugh-Nagumo Operation.
Args:
v (float): transmembrane potential
a (float): positive parameter e [0, 0.5]
Returns:
(float): difference between dvdt and d^2v/dx^2
Source of mathematical model is below:
@article{feng2015finite,
title={A finite difference method for the FitzHugh-Nagumo equations},
author={Feng, Hongsong and Lin, Runchang},
journal={Dynamics of Continuous, Discrete and Impulsive Systems. Series B: Applications \& Algorithms},
volume={22},
pages={401--412},
year={2015}
}
'''
return v * (1 - v) * (v - a)
def HeatEquation(v):
'''Function which constructs the righthand side of the heat equation.
Args:
v (float): transmembrane potential
Returns:
(float): difference between dvdt and d^2v/dx^2
'''
# This is used for testing only.
return 0