Continue to Site

# sample-and-hold circuit simulation using MATLAB code

Status
Not open for further replies.

#### euniceliu

##### Newbie level 5
I have no idea how to implement the simulation of a sample-and-hold circuit. The model is as basic as "Vo(t) = Vi(t) + RC*dVo(t)/dt", where C is constant and R is a nonlinear function of Vo(t). If I use a sine wave as the input signal, Vi(t), then how can I get Vo(t)?

Since Vo(t) is also a nonlinear function of Vi(t), I'm considering to let R be the nonlinear function of Vi(t). Assume the nonlinear order is 2, then R approaches to a0+a1*Vi(t)+a2*Vi(t)^2 where a0, a1 and a2 are coefficients. In this case, the derivative of Vo(t) is related with the previous and post samples at sample time t. I'm wondering how to derive the solution to Vo(t).

Any inputs or suggestions are welcome! Thank you very much in advance!

Why dont you use simulink? It has a block for sample and hold

I have to use Matlab code or C code, rather than simulink.

Status
Not open for further replies.