<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=State_space_representation</id>
		<title>State space representation - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=State_space_representation"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=State_space_representation&amp;action=history"/>
		<updated>2026-05-13T01:47:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=State_space_representation&amp;diff=1996&amp;oldid=prev</id>
		<title>Gyan: Created page with '{|border=&quot;1&quot; width=100% ! width=20% | Visual Cue ! width=60% | Narration  |- | Show first slide | Now we see how to represent a system in state space. We use the following A, B, …'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=State_space_representation&amp;diff=1996&amp;oldid=prev"/>
				<updated>2012-12-24T10:36:26Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;{|border=&amp;quot;1&amp;quot; width=100% ! width=20% | Visual Cue ! width=60% | Narration  |- | Show first slide | Now we see how to represent a system in state space. We use the following A, B, …&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{|border=&amp;quot;1&amp;quot; width=100%&lt;br /&gt;
! width=20% | Visual Cue&lt;br /&gt;
! width=60% | Narration&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show first slide&lt;br /&gt;
|&lt;br /&gt;
Now we see how to represent a system in state space. We use the following A, B, C, D parameters: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    A = [0, 1; -1, -0.5]&lt;br /&gt;
    B = [0; 1] &lt;br /&gt;
    C = [1, 0] &lt;br /&gt;
    D = [0]&lt;br /&gt;
|&lt;br /&gt;
We must define the initial state of the system. In order to show the true utility of this method, we choose a non-zero initial state; let it be 1: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    x0=[1; 0] &lt;br /&gt;
|&lt;br /&gt;
We formally define the system with the above parameters as follows using the same 'syslin' function we used earlier: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    SSsys = syslin('c', A, B, C, D, x0)&lt;br /&gt;
|&lt;br /&gt;
We simulate this system for 50 seconds: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    t = [0: 0.1: 50];&lt;br /&gt;
|&lt;br /&gt;
However, since the initial state of the system is at 1, we choose a step of 0.5:&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    u = 0.5*ones(1, length(t));&lt;br /&gt;
|&lt;br /&gt;
We simulate the system: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    [y,x] = csim(u, t, SSsys);&lt;br /&gt;
|&lt;br /&gt;
We plot the output: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    scf(1); plot(t, y)&lt;br /&gt;
|&lt;br /&gt;
We can also plot the internal state of the system: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    scf(2); plot(t, x)&lt;br /&gt;
|&lt;br /&gt;
We can view the root locus of this sytem: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    evans(SSsys) //zoom in&lt;br /&gt;
|&lt;br /&gt;
For a more intuitive view of this system, we can convert this system from state space to its transfer function representation using the ss2tf function: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    ss2tf(SSsys) &lt;br /&gt;
|&lt;br /&gt;
To verify that this is indeed the same system, we compare the roots of this transfer function to the eigenvalues of the system matrix: &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
    roots(denom(ans))&lt;br /&gt;
    spec(A)&lt;br /&gt;
|&lt;br /&gt;
END&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Gyan</name></author>	</entry>

	</feed>