This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using static System.Math; | |
| namespace ODEDemo { | |
| internal static class Program { | |
| public static void Main() { | |
| const double ts = 0.0; //Time of start | |
| const double te = 2.0 * PI; //Time of end | |
| const double dt = 0.1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public struct Vector { | |
| private double[] e; | |
| public int Length => e.Length; | |
| public Vector(int size) => e = new double[size]; | |
| public Vector(params double[] elements) => e = elements; | |
| public double this[int index] { | |
| get => e[index]; | |
| set => e[index] = value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class NumericalModelWithODE { | |
| public Vector InitialValues { get; } | |
| public double TimeStart { get; set; } = 0.0; | |
| public double TimeEnd { get; set; } = 1.0; | |
| public NumericalModelWithODE(params double[] initialValues) => InitialValues = new Vector(initialValues); | |
| public abstract Vector Function(double t, Vector x); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class Solver { | |
| public static double Delta { get; set; } = 0.1; | |
| public static void Euler(NumericalModelWithODE model) => Euler(model, Console.Out); | |
| public static void Euler(NumericalModelWithODE model, TextWriter file) { | |
| var t = model.TimeStart; | |
| var te = model.TimeEnd; | |
| var x = model.InitialValues; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.IO; | |
| using static System.Math; | |
| namespace EulerMethod { | |
| class Program { | |
| private class Wave : NumericalModelWithODE { | |
| public Wave() : base(0.0, 1.0) => TimeEnd = 2.0 * PI; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ./FiringRateCalculator grspk.zip | |
| "grspk.zip"には以下のファイルが含まれています. | |
| gr.spk.0.0 gr.spk.0.1 gr.spk.0.10 gr.spk.0.100 gr.spk.0.11 gr.spk.0.12 | |
| gr.spk.0.13 gr.spk.0.14 gr.spk.0.15 gr.spk.0.16 gr.spk.0.17 gr.spk.0.18 | |
| gr.spk.0.19 gr.spk.0.2 gr.spk.0.20 gr.spk.0.21 gr.spk.0.22 gr.spk.0.23 | |
| gr.spk.0.24 gr.spk.0.25 gr.spk.0.26 gr.spk.0.27 gr.spk.0.28 gr.spk.0.29 | |
| gr.spk.0.3 gr.spk.0.30 gr.spk.0.31 gr.spk.0.32 gr.spk.0.33 gr.spk.0.34 | |
| gr.spk.0.35 gr.spk.0.36 gr.spk.0.37 gr.spk.0.38 gr.spk.0.39 gr.spk.0.4 | |
| gr.spk.0.40 gr.spk.0.41 gr.spk.0.42 gr.spk.0.43 gr.spk.0.44 gr.spk.0.45 | |
| gr.spk.0.46 gr.spk.0.47 gr.spk.0.48 gr.spk.0.49 gr.spk.0.5 gr.spk.0.50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ./FiringRateCalculator -h | |
| Usage : $ ./FiringRateCalculator [FILE].zip [options] | |
| [options] | |
| -h|--help : Helpを表示して終了する. | |
| -s [FILE] : 設定ファイルを指定する. | |
| -y : 自動で"ok"を入力する. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 発火率計算のための情報を設定します. | |
| 入力された値はそのまま使用されるので,データの単位と合うように入力してください. | |
| データの最終時刻 : 6000 | |
| 時間窓の幅 : 1000 | |
| サンプリングレート : 0.03 | |
| ニューロンの総数 : 2114 | |
| データの読み込みを開始します. | |
| 完了しました. | |
| 発火率の計算を開始します. | |
| 完了しました. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 結果をファイルに出力します. | |
| 以下のフォーマットに従って,ニューロンIDの登録を行ってください. | |
| >> Name [StartID]:[EndID] | |
| Example : >> Gr 0:1023 | |
| 操作を終了するには"ok"を入力してください. | |
| >> Gr 0:1023 | |
| output/Gr.frate.gr.spk.0.0 に出力中. | |
| >> Go 1024:2047 | |
| output/Go.frate.gr.spk.0.0 に出力中. | |
| >> ok |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FileLoad gr.spk.0.0 | |
| FileLoad gr.spk.0.50 | |
| FileLoad gr.spk.0.100 | |
| EndTime 6000 | |
| TimeBin 1000 | |
| SamplingRate 0.03 | |
| NumberOfNeurons 2114 | |
| Output Gr 0:1023 |
OlderNewer