Skip to content

Commit f37b2b9

Browse files
committed
Finally got the dynamic version of sparse functioning
1 parent a48d2d6 commit f37b2b9

File tree

191 files changed

+25931
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+25931
-52
lines changed

Assets/Save.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Vector = MathNet.Numerics.LinearAlgebra.Vector<double>;
4+
namespace C2M2.NeuronalDynamics.Simulation
5+
{
6+
7+
public class GatingVariable
8+
{
9+
// Name of the gating variable (i.e: n, m, h)
10+
public string Name { get; }
11+
12+
// Alpha and Beta functions for the gating variable
13+
public Func<Vector, Vector> Alpha { get; }
14+
public Func<Vector, Vector> Beta { get; }
15+
16+
public double Exponent { get; }
17+
18+
// Probability is the initial state probability for the gating variable
19+
public double Probability { get; set; }
20+
public Vector CurrentState { get; set; }
21+
public Vector PreviousState { get; set; }
22+
23+
public GatingVariable(string name, Func<Vector, Vector> alpha, Func<Vector, Vector> beta, double exponent, double probability, int nodeCount)
24+
{
25+
Name = name;
26+
Alpha = alpha;
27+
Beta = beta;
28+
Exponent = exponent;
29+
Probability = probability;
30+
CurrentState = Vector.Build.Dense(nodeCount, probability);
31+
PreviousState = CurrentState.Clone();
32+
}
33+
34+
}
35+
36+
public class IonChannel
37+
{
38+
public string Name { get; set; } // Name of the ion channel (e.g., K+ channel)
39+
public double Conductance { get; set; } // g (conductance)
40+
public double ReversalPotential { get; set; } // E (reversal potential)
41+
public List<GatingVariable> GatingVariables { get; set; } // List of gating variables (can be dynamic)
42+
public bool IsActive { get; set; } // Indicates if the ion channel is active
43+
44+
public IonChannel(string name, double conductance, double reversalPotential)
45+
{
46+
Name = name;
47+
Conductance = conductance;
48+
ReversalPotential = reversalPotential;
49+
GatingVariables = new List<GatingVariable>();
50+
IsActive = true;
51+
}
52+
public void AddGatingVariable(GatingVariable gatingVariable)
53+
{
54+
GatingVariables.Add(gatingVariable);
55+
}
56+
57+
public void RemoveGatingVariable(GatingVariable gatingVariable)
58+
{
59+
GatingVariables.Remove(gatingVariable);
60+
}
61+
62+
public void Activate()
63+
{
64+
IsActive = true;
65+
}
66+
67+
public void Deactivate()
68+
{
69+
IsActive = false;
70+
}
71+
}
72+
}

Assets/Scripts/C2M2/NeuronalDynamics/Simulation/IonChannel.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/C2M2/NeuronalDynamics/Simulation/SparseSolverTestv1.cs

+253-52
Large diffs are not rendered by default.
Binary file not shown.
4.74 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
This file defines some of the browsers that Microsoft's implementation provides in
3+
<windir>\Microsoft.NET\Framework\<ver>\CONFIG\Browsers\*.browser
4+
5+
It is not derived from any file distributed with Microsoft's implementation. Since
6+
we can't distribute MS's browser files, we use browscap.ini to determine
7+
browser capabilities. Then, if and only if the application contains App_Browser/*.browser
8+
files and we are using .NET 2.0 or higher, we supplement the capabilities with the
9+
information in those files and the files in this directory. The primary goal of this file
10+
is provide browser definitions that might be referenced in App_Browser/*.browser files.
11+
-->
12+
<browsers>
13+
<defaultBrowser id="Default">
14+
</defaultBrowser>
15+
<browser id="Default">
16+
<identification>
17+
<userAgent match="." />
18+
</identification>
19+
</browser>
20+
<browser id="IE6to9" parentID="Default">
21+
<identification>
22+
<capability name="majorver" match="^[6-9]" />
23+
<capability name="browser" match="^(IE|AOL)$" />
24+
</identification>
25+
</browser>
26+
<browser id="Opera8to9" parentID="Default">
27+
<identification>
28+
<capability name="majorver" match="^[8-9]" />
29+
<capability name="browser" match="^Opera$" />
30+
</identification>
31+
</browser>
32+
<browser id="Safari" parentID="Default">
33+
<identification>
34+
<capability name="browser" match="^Safari$" />
35+
</identification>
36+
</browser>
37+
<browser id="Mozilla" parentID="Default">
38+
<identification>
39+
<capability name="browser" match="^Mozilla" />
40+
</identification>
41+
</browser>
42+
</browsers>

0 commit comments

Comments
 (0)