A bias value 2 is given to sinwave, T is 0.5, and i want to get it using ZOH with a sample time 0.25, but the error is bigger with time,why? and how to get the pure bias value?

the simple example is attached.

1.plecs (4.84 KB)

A bias value 2 is given to sinwave, T is 0.5, and i want to get it using ZOH with a sample time 0.25, but the error is bigger with time,why? and how to get the pure bias value?

the simple example is attached.

1.plecs (4.84 KB)

The error here is on the order of 1e-15 in the first 2 seconds and will increase as the time increases. For example, at 200 seconds the error is on the order of 1e-13.

The reason the value youâ€™re observing in the scope is close-to, but not exactly, 2 is because of limitations of floating point arithmetic.