so in this lesson we will make our first simulation in Xcos first I want to
show you the system so this is our system so we have a transfer function of
two divided by s plus two the same which we studied before couple of thing you
should note here is that if you want to have a graph looking like this so the
maximum time of simulation should be around three second and similarly the
maximum value of the graph in the Y direction should be around 1.2 1.3
something like that because these parameters we have to set in scope and
in clock etc so now let's start the simulation so first we get the transfer
function from this continuous-time systems so you can just click here and
then drag it similarly from sources we need a clock and a step function so this
is our clock this is our step function and now the last thing we need is a
scope which is in sync so the single display scope which is this one now we
just make connections and activation connection now we align these blocks
align these vertically and now we have to set the parameters so first start
from the scope so simulation setup as you can double-click so here's the final
integration time the maximum time for the simulation which is around 3 second
as you can see here so we will just put a value of 3 which is already I think 3
is there so 3 is this one and in this we also have this Y minimum and Y maximum
and because we are using the step function so step function gives one so
we need a little bit larger than one so we can say that 1 point 2 and Y minimum
should be 0 and refresh period should be you can say 2 second
larger period 22nd okay no clock so a real point one is okay initialization
time you can change to zero as well so zero no our transfer function it's two
divided by s plus 2 so we change it to two here and no the step function we
want to apply the step function at zero so therefore we set it to zero and the
final value of the step is 1 initial where initial value is 0 and the final
value of the step is 1 so no no we are ready to apply the simulation so just
press this button start and as you can see that it will show you the simulation
no because our scaled on the x axis is quite large so this is a very fresh time
so we can reduce this little bit so that we can get a similar looking graph but
if you just take a closer from here to let us say at this point so then you can
see that our graph is exactly the same and if you see the 63% value so 63 is
around here probably and if you drop vertical you will get exactly 0.5 second
of time so it means because our age 2 so this should be 1/2 which is 0.5 so this
is how you Samuel eight so this was a basic simulation of a very simple
transfer function and you can do a little bit of variation for example we
are applying the stop step function here at 0 you can apply it at 1 with a delay
of 1 second so the graph will start from here so let's close this and now if we
apply this the step time is 1 for example if we put 1 here and then we do
the simulation again as you can see that no over step function is applied at at
time 1 so it's a delay of 1 second so you can just zoom this click on left
corner from where you want to zoom and and the right bottom corner up to which
points you want to zoom so now you can see that our step function is applied at
time 1 so you can change this little bit you can tweak it you can change the
graph you can move it as well if you want so however you want you can use
this simulation and this figure and everything so this is the way how we
make simulations in X caused