driftlet 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -76
- package/docs/device.md +51 -21
- package/docs/kit.md +14 -3
- package/docs/reliability.md +60 -3
- package/docs/statistics.md +10 -0
- package/llms.txt +566 -295
- package/package.json +1 -1
- package/src/channels.js +27 -4
- package/src/describe.js +1 -1
- package/src/device.js +57 -14
- package/src/index.js +6 -1
- package/src/solution.js +16 -2
- package/src/solver.js +92 -48
- package/src/stack.js +6 -4
- package/src/types.js +2 -1
- package/types/channels.d.ts +14 -3
- package/types/solver.d.ts +4 -2
- package/types/stack.d.ts +6 -5
- package/types/types.d.ts +5 -0
package/src/types.js
CHANGED
|
@@ -114,7 +114,8 @@
|
|
|
114
114
|
* @typedef {'blocked' | 'equilibrium'
|
|
115
115
|
* | { type: 'equilibrium', offset?: number, mu?: number }
|
|
116
116
|
* | { type: 'conductance', G: number, offset?: number }
|
|
117
|
-
* | { type: 'exchange', k: number, mu: number }
|
|
117
|
+
* | { type: 'exchange', k: number, mu: number }
|
|
118
|
+
* | { type: 'velocity', v: number, offset?: number, mu?: number }} ContactSpeciesLink
|
|
118
119
|
*/
|
|
119
120
|
/**
|
|
120
121
|
* 'bulk': the end node is plain bulk (locally neutral, no double layer); 'neutral': no charge at
|
package/types/channels.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function ghkCurrent(z: any, inside: any, outside: any, V: any, T: any): number;
|
|
2
2
|
/**
|
|
3
|
-
* Hodgkin and Huxley's squid-axon channels
|
|
3
|
+
* Hodgkin and Huxley's squid-axon channels: for a membrane face with the outside on its left
|
|
4
4
|
* (so the gates' voltage, φ_right − φ_left, is the membrane potential): the face's `gates`, and
|
|
5
5
|
* `species` links for Na⁺ (P·m³h), K⁺ (P·n⁴) and the leak (ungated), to spread into the face
|
|
6
6
|
* beside its φ law, `{ phi: { type: 'capacitive', C: 0.01 }, ...hh }`, adding links (or blocks)
|
|
@@ -12,12 +12,21 @@ export function ghkCurrent(z: any, inside: any, outside: any, V: any, T: any): n
|
|
|
12
12
|
* (`leak`, of charge `leakZ`: Cl⁻ by default, whose Nernst level in squid is near their leak
|
|
13
13
|
* reversal, −54 mV). The
|
|
14
14
|
* rates are theirs at 6.3 °C, scaled to `T` by Q₁₀ = 3.
|
|
15
|
+
*
|
|
16
|
+
* Or with `linear: true`, Hodgkin and Huxley's own linear channels on the face: conductance links,
|
|
17
|
+
* G = g, gated the same, whose currents are g(V − E) with E each ion's Nernst level at the
|
|
18
|
+
* concentrations on either side (so `inside`, `outside` and `at` aren't needed).
|
|
19
|
+
*
|
|
20
|
+
* Or, given `area` (membrane per volume of the region, 2/a for an axon of radius a), for a membrane
|
|
21
|
+
* port along a region: links that are their linear conductances, G = g × area per volume, gated the
|
|
22
|
+
* same, each ion's reversal potential following from the port's bath and the concentrations inside
|
|
23
|
+
* (so `inside`, `outside` and `at` aren't needed).
|
|
15
24
|
* @param {{ inside: object, outside: object, T?: number, g?: { Na?: number, K?: number, leak?: number },
|
|
16
|
-
* leak?: string, leakZ?: number, at?: number, names?: { Na?: string, K?: string } }} opts concentrations in
|
|
25
|
+
* leak?: string, leakZ?: number, at?: number, names?: { Na?: string, K?: string }, linear?: boolean, area?: number }} opts concentrations in
|
|
17
26
|
* mol/m³ by species name, K, S/m², V
|
|
18
27
|
* @returns {{ gates: object, species: object }}
|
|
19
28
|
*/
|
|
20
|
-
export function hodgkinHuxley({ inside, outside, T, g, leak, leakZ, at, names }?: {
|
|
29
|
+
export function hodgkinHuxley({ inside, outside, T, g, leak, leakZ, at, names, linear, area }?: {
|
|
21
30
|
inside: object;
|
|
22
31
|
outside: object;
|
|
23
32
|
T?: number;
|
|
@@ -33,6 +42,8 @@ export function hodgkinHuxley({ inside, outside, T, g, leak, leakZ, at, names }?
|
|
|
33
42
|
Na?: string;
|
|
34
43
|
K?: string;
|
|
35
44
|
};
|
|
45
|
+
linear?: boolean;
|
|
46
|
+
area?: number;
|
|
36
47
|
}): {
|
|
37
48
|
gates: object;
|
|
38
49
|
species: object;
|
package/types/solver.d.ts
CHANGED
|
@@ -294,6 +294,7 @@ export class Solver {
|
|
|
294
294
|
* animation can call it once per frame; the step size carries over between calls.
|
|
295
295
|
*/
|
|
296
296
|
integrate(tEnd: any, opts?: {}): {
|
|
297
|
+
stopped?: string;
|
|
297
298
|
converged: boolean;
|
|
298
299
|
done: boolean;
|
|
299
300
|
steps: number;
|
|
@@ -307,7 +308,7 @@ export class Solver {
|
|
|
307
308
|
};
|
|
308
309
|
};
|
|
309
310
|
landing: any;
|
|
310
|
-
_extrapolate(out: any,
|
|
311
|
+
_extrapolate(out: any, h: any): any;
|
|
311
312
|
_predict(pred: any, bdf: any): {
|
|
312
313
|
scale: number;
|
|
313
314
|
order: number;
|
|
@@ -381,6 +382,7 @@ export class Solver {
|
|
|
381
382
|
_regionShift(yr: any, yi: any): Float64Array<any>[];
|
|
382
383
|
_regionEdgeRows(): Uint8Array<any>;
|
|
383
384
|
_currentCuts(): {
|
|
385
|
+
s: any;
|
|
384
386
|
idx: any[];
|
|
385
387
|
g: any[];
|
|
386
388
|
d: any[];
|
|
@@ -424,7 +426,7 @@ export class Solver {
|
|
|
424
426
|
iterations: any;
|
|
425
427
|
history: any;
|
|
426
428
|
};
|
|
427
|
-
_continuation(opts: any, level: any, target: any, r: any, warm: any): any;
|
|
429
|
+
_continuation(opts: any, k: any, level: any, target: any, r: any, warm: any, hold: any): any;
|
|
428
430
|
_solveSteady(opts?: {}): {
|
|
429
431
|
converged: boolean;
|
|
430
432
|
steps: number;
|
package/types/stack.d.ts
CHANGED
|
@@ -31,16 +31,17 @@ export function drive(d: any, path: any): any;
|
|
|
31
31
|
*/
|
|
32
32
|
export function ohmic(d?: number, carriers?: string[]): any;
|
|
33
33
|
/**
|
|
34
|
-
* A bath: a neutral composition `c` (mol/m³) held at the contact
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* A bath: a neutral composition `c` (mol/m³) held at the contact. With a `reference`, the charged
|
|
35
|
+
* species a reference electrode would sense (Cl⁻ for Ag/AgCl), its levels are referred to that
|
|
36
|
+
* species, which is the terminal. Without one, `bath(c, drive)`, the terminal voltage is the
|
|
37
|
+
* bath's φ: an ideal salt bridge, the convention of membrane potentials.
|
|
37
38
|
* @param {Record<string, number>} c
|
|
38
|
-
* @param {string} reference
|
|
39
|
+
* @param {string | number | object} [reference] the reference species, or the drive
|
|
39
40
|
* @param {number | object} [drive]
|
|
40
41
|
* @param {{ offset?: number }} [opts] where the reference species sits relative to the terminal
|
|
41
42
|
* voltage, V_ref = V + offset (V)
|
|
42
43
|
*/
|
|
43
|
-
export function bath(c: Record<string, number>, reference
|
|
44
|
+
export function bath(c: Record<string, number>, reference?: string | number | object, d?: number, { offset }?: {
|
|
44
45
|
offset?: number;
|
|
45
46
|
}): any;
|
|
46
47
|
/**
|
package/types/types.d.ts
CHANGED
|
@@ -264,6 +264,11 @@ export type ContactSpeciesLink = "blocked" | "equilibrium" | {
|
|
|
264
264
|
type: "exchange";
|
|
265
265
|
k: number;
|
|
266
266
|
mu: number;
|
|
267
|
+
} | {
|
|
268
|
+
type: "velocity";
|
|
269
|
+
v: number;
|
|
270
|
+
offset?: number;
|
|
271
|
+
mu?: number;
|
|
267
272
|
};
|
|
268
273
|
/**
|
|
269
274
|
* 'bulk': the end node is plain bulk (locally neutral, no double layer); 'neutral': no charge at
|