# How to use integrator and comparator in simulink

Status
Not open for further replies.

#### arrt

##### Newbie level 4 I am also need to use time-constant integral, when initial x0=0 or 1, but the condition of integrating is defined by such formula: dx/dt=-alpha*x--so the solution is something like this--x=exp(-alpha*t) so I do not know how to define integral in simulink--there seems to be just intial value condition --is it mean that the integrating is just linear? So waht parameters I should note in integral block in simulink//I also has simialr question about Micro-cap as there is also the same macros--integral--that has scale value(?) and initial condition? Would you suggest me anything..
I just tried simple example with initial condition where, initial value is 2--so if input from the constant source is 0--that is line horizontal, if 1--it is linear under 45 grades, and more input is bigger--more the line is approximate to vertical line. So what integral is working and how for example define the EXP(k*t) as I undestand that 0 input means no dependence on time, 1-- means the linear dependence, and 2--is more complex for example if t=0 x=1.1, t=1//
What abou comparator I need to use such condition if input E>0, then Sn+1=x, if E=0, if E<0, Sn+2=x-A. So how can I do such condition. After it one of Sn should be the input for aforementioned integrator

#### arrt

##### Newbie level 4 How use comparator and interator in microcap?

I need to implement the logic circuit in Micro-cap that has such components as adders, comparators and integrator. So I predominantly need to use macros components. But I do not know such things.1. If I use simple comparator that compare two signals can I add the logical 1's at output that go further to analog adder(I cannot check cause due to looking time analysis I jus see the input signals from batteries but not v(out). The next thing. If I have such expression as if E>0 then An 1=x, E<0 then An 2=x-A. What elements I could use to get for example x at the output? 3.The next things relates to wire division. There is such component in Simulink as Merge for signals but I could not find it for in microcap. I am also would like to know what do mean the parameters of INT (integrator)-scale and winit. Is it linear increasing integral with time. For example if my formula is dx/dt=-alfa*t what should I define in integral?

Status
Not open for further replies.