Skip to content
Snippets Groups Projects
Commit f331f8e7 authored by JupyterHub User's avatar JupyterHub User
Browse files

Add another example to V10_kalmanfilter_demonstration.ipynb and change Noise(...) in Pysim/Block.py

parent 22edf0dc
No related branches found
No related tags found
1 merge request!1merge develop into master
import numpy
sin = numpy.sin
from random import triangular
from random import gauss
#########################################################################
#### Abstract class for continuous time block in a block diagram ########
......@@ -122,7 +122,7 @@ class UnknownWaveSource(Block):
#########################################################################
class Noise(Block):
def __init__(self,inp,out,Am):
def __init__(self,inp,out,sigma):
super(Noise, self).__init__()
self.noutput = 1
self.outpos = numpy.zeros((self.noutput),dtype=numpy.int)
......@@ -130,14 +130,13 @@ class Noise(Block):
self.ninput = 1
self.inpos = numpy.zeros((self.ninput),dtype=numpy.int)
self.inpos[0] = inp
self.Am = Am
self.sigma = sigma
self.u = numpy.zeros((self.ninput))
self.y = numpy.zeros((self.noutput))
#self.y[0] = startv
def Step(self,t,dt):
noise = ([self.Am*triangular(0.0,0.5,1.0)-(self.Am/2.0)])
self.y = self.u + numpy.array(noise)
noise = numpy.array([gauss(0,self.sigma)])
self.y = self.u + noise
#########################################################################
######################### Square signal source ##########################
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
notebooks/bilder/v10_kalmanfilter.png

52.3 KiB | W: | H:

notebooks/bilder/v10_kalmanfilter.png

52.7 KiB | W: | H:

notebooks/bilder/v10_kalmanfilter.png
notebooks/bilder/v10_kalmanfilter.png
notebooks/bilder/v10_kalmanfilter.png
notebooks/bilder/v10_kalmanfilter.png
  • 2-up
  • Swipe
  • Onion skin
notebooks/bilder/v10_regelstrecke.png

88.4 KiB

notebooks/bilder/v10_roboter.png

108 KiB | W: | H:

notebooks/bilder/v10_roboter.png

108 KiB | W: | H:

notebooks/bilder/v10_roboter.png
notebooks/bilder/v10_roboter.png
notebooks/bilder/v10_roboter.png
notebooks/bilder/v10_roboter.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment