Hello! I am having trouble with my simulink model. I have coupled second order differential equations, one of which has a forcing function on it. The equations of motion are as follows (using xdd to express "double dot" or the second derivative, and xd for "dot" or the first derivative):
m1xdd1+c(xd1-xd2)+k1(x1-x2)=0
m2xdd2+c(xd2-xd1)+k1(x2-x1)+k2x2=0.01*k2*sin(wt)
where m1, m2, k1, k2, c, and w are all constants. This is a function of x1, x2, and time.
Everything is wired up correctly, and the expected result would be some sort of combined sinusoidal curve. However, I have been getting a flat line up until the end of my time interval, where it shoots to infinity. It shoots to infinity if I end the interval at 2 seconds, 5 seconds, 10 seconds, whatever--it is always at the end. For a larger time interval (20s), an error occurred stating that at one integrator, there was an infinite value. This integrator was connected to the forcing function so I believe it is a problem with my initial conditions.
I saw on another forum with someone with a problem with drift, where someone stated that there was a problem with initial conditions and that it should be a function of w. I tried figuring out that initial condition by integrating that function (0.01k2sin(wt)), getting -k2/w*0.01*cos(w*t), plugging in t=0, but the problem is still occurring.
I've tried messing with my tolerances as well (this was what the error message suggested), but I don't believe that is the issue because of the flatline result for a majority of the graph.
Any help would be appreciated!
m1xdd1+c(xd1-xd2)+k1(x1-x2)=0
m2xdd2+c(xd2-xd1)+k1(x2-x1)+k2x2=0.01*k2*sin(wt)
where m1, m2, k1, k2, c, and w are all constants. This is a function of x1, x2, and time.
Everything is wired up correctly, and the expected result would be some sort of combined sinusoidal curve. However, I have been getting a flat line up until the end of my time interval, where it shoots to infinity. It shoots to infinity if I end the interval at 2 seconds, 5 seconds, 10 seconds, whatever--it is always at the end. For a larger time interval (20s), an error occurred stating that at one integrator, there was an infinite value. This integrator was connected to the forcing function so I believe it is a problem with my initial conditions.
I saw on another forum with someone with a problem with drift, where someone stated that there was a problem with initial conditions and that it should be a function of w. I tried figuring out that initial condition by integrating that function (0.01k2sin(wt)), getting -k2/w*0.01*cos(w*t), plugging in t=0, but the problem is still occurring.
I've tried messing with my tolerances as well (this was what the error message suggested), but I don't believe that is the issue because of the flatline result for a majority of the graph.
Any help would be appreciated!