public void CanGetConfiguration()
        {
            const double frequency = 1.0;
            const double phase     = 2.0;
            const double amplitude = 3.0;

            var source = new SinSource(frequency, phase, amplitude);

            Assert.Equal(frequency, source.Frequency);
            Assert.Equal(phase, source.Phase);
            Assert.Equal(amplitude, source.Amplitude);
        }
Exemple #2
0
        private static void ForwardModeling()
        {
            var source     = new SinSource(1.0, 0.0, 1.0);
            var seismogram = new FileSeismogram(new StreamWriter("forward.txt"));

            var simulation = new Simulation(source, seismogram);

            simulation.Execute(0.0, 0.01, 1.0);

            seismogram.Close();

            Console.WriteLine("Forward modeling finished!");
        }
        public void CanChangeFrequency(double frequency)
        {
            var source = new SinSource(frequency, 0.0, 1.0);

            Assert.Equal(1.0, source.Sample(1.0 / frequency / 4.0), 2);
        }
        public void CanChangePhase(double phase, double time)
        {
            var source = new SinSource(1.0, phase, 1.0);

            Assert.Equal(1.0, source.Sample(time), 2);
        }
        public void CanChangeAmplitude(double amplitude)
        {
            var source = new SinSource(1.0, 0.0, amplitude);

            Assert.Equal(amplitude, source.Sample(0.25), 2);
        }
        public void ItIsASineWave(double time, double value)
        {
            var source = new SinSource(1.0, 0.0, 1.0);

            Assert.Equal(value, source.Sample(time), 2);
        }