forked from btessler92/netpyneca3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aux_fun.inc
43 lines (32 loc) · 1.15 KB
/
aux_fun.inc
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
42
43
: $Id: aux_fun.inc,v 1.1 2009/11/04 01:24:52 samn Exp $
COMMENT
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// NOTICE OF COPYRIGHT AND OWNERSHIP OF SOFTWARE
//
// Copyright 2007, The University Of Pennsylvania
// School of Engineering & Applied Science.
// All rights reserved.
// For research use only; commercial use prohibited.
// Distribution without permission of Maciej T. Lazarewicz not permitted.
//
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENDCOMMENT
:-------------------------------------------------------------------
FUNCTION fun1(v(mV),V0(mV),A(/ms),B(mV))(/ms) {
fun1 = A*exp((v-V0)/B)
}
FUNCTION fun2(v(mV),V0(mV),A(/ms),B(mV))(/ms) {
fun2 = A/(exp((v-V0)/B)+1)
}
FUNCTION fun3(v(mV),V0(mV),A(/ms),B(mV))(/ms) {
if(fabs((v-V0)/B)<1e-6) {
:if(v==V0) {
fun3 = A*B/1(mV) * (1- 0.5 * (v-V0)/B)
} else {
fun3 = A/1(mV)*(v-V0)/(exp((v-V0)/B)-1)
}
}
FUNCTION min(x,y) { if (x<=y){ min = x }else{ min = y } }
FUNCTION max(x,y) { if (x>=y){ max = x }else{ max = y } }