Actually, i am going to use VB.net to build such a model. Before that, i need to understand how to build this mathematics model.

I have tried to use the code you posted before in MatLab, but i was given a different graphic and not similar to yours. Are you plotting the result of function rv=KalmanSim only?

Is Data() a build-in function? I can't excute directly by typing x=data(1) in command window.

What do the S represent for ?

Do you mind to show me the full model you built?

besides, i don't know what really the power consumption is. So i do not sure that it is not dynamic. Should i consider the estimation on state (X(K+1)=FX(K)+u(k)if it is dynamic?

Thank You