I am trying to implement simple 2 state system of simple pendulum. though the x2 values are correct, the x1 is not changing at all. its a straight line with 0 values. what can be possible reasons.
I am using codeblock to run the c code and then plot the graph in matlab.
I am trying to implement simple 2 state system of simple pendulum. though the x2 values are correct, the x1 is not changing at all. its a straight line with 0 values. what can be possible reasons.
I am using codeblock to run the c code and then plot the graph in matlab.
Hello Vaishali,
did you consider that array indices start with zero in C code? If the states x are position and velocity, then you probably want
Otherwise, what is x[0], x[1], x[2] and why is there no out[2]?
Regards,
Andreas
There are only 2 states x(0) and x(1) . There is no x(2) - hence only out0 which is x0_dot and out1 which is x1_dot
Is the problem solved if you use the correct indices x[0] and x[1]? Otherwise, I need more information, e.g. the complete probfct.
yes yes - solved -- thanks a lot for pointing out the basic error