# state space formulation of a sinusoidal system

Let $f=A\sin{\omega t}=x_1$ and $\dot{f}=A\omega\cos{\omega t}=\dot{x}_1=x_2$. Let the output be $y=cA\omega$, where $c=1$ is a constant. I want to represent this in a state space formulation:

$\dot{x}=\underline{A}x+\underline{B}u$

$y=\underline{C}x+\underline{D}u$

What will $C$ be? I tried: $A\omega=\frac{A}{t}\arcsin{\frac{x_1}{A}}$, but does this make sense? Another possibility is $A\omega=\frac{-x_2}{\cos{\omega t}}$. Which one should I choose?

• I'm afraid this makes no sense at all. The output is a constant for all possible inputs? You use $A$ in the first line of your question, but a different (?) $A$ in the state-space equations. Do you realize that the system needs to be linear in order to be representable in this way? But given the output, the system can't be linear. And, BTW, you also got the sign of $\dot{f}$ wrong. – Matt L. Oct 31 '14 at 9:11
• I think you're right, I will have a look and come back. – student1 Nov 2 '14 at 1:40
• OK, we can think of this as if you have a meter that gives you the amplitude of the electric / magnetic field, $A\omega$ in this case. Only change in $\omega$ can cause a change in the output. – student1 Nov 2 '14 at 14:35
• Specifically, the meter gives the average value, that's why change in time doesn't affect it. – student1 Nov 2 '14 at 15:06

I make you an example about how to write state-space equations using a dynamic second order equation to let you understand the procedure.

The starting equation is: $$M a + C v + K s = f$$ $C$ is damping, $K$ is stiffness and $M$ is the mass.

Then build your state vector $x =\pmatrix{s\\ v}$

Now write the equation like $a = 1/M (f - C v - K s)$

$\dot{x} = \pmatrix{v\\ a}$ is the derivative of the state vector.

In the state space:

$\dot{x} = \pmatrix{0& 1, \\-K/M& -C/M} x + \pmatrix{0 \\ 1/M} f$

If you want the displacement as output

$y = \pmatrix{1\\ 0} x$

• Thanks but I do know how to write a SS model. I am afraid your answer is not related to my question above, but thanks again. – student1 Nov 3 '14 at 23:30
• Since you chosed 2 states it means your starting equation was a second order equation right? Then it might be better if you show us the starting equation because it might be a problem related to the choice of the states variable – Rhei Nov 4 '14 at 5:50
• Actually there is no equation. I simply wanted to apply state space model to a system where you have the an output y as above and states as above. I can't think of specific differential equation. – student1 Nov 4 '14 at 5:51
• But what did you write inside matrix A and B if you have no equation? – Rhei Nov 4 '14 at 16:37
• I wanted to model an electric field meter. The 'equation' is simply E=Acos(wt). I considered this to be a state, and then assumed the output is an RMS value, given by a constant, say Aw. – student1 Nov 4 '14 at 17:43