<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://fbswiki.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Figure_5.1%3A_Response_of_a_damped_oscillator</id>
	<title>Figure 5.1: Response of a damped oscillator - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://fbswiki.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Figure_5.1%3A_Response_of_a_damped_oscillator"/>
	<link rel="alternate" type="text/html" href="http://fbswiki.org/wiki/index.php?title=Figure_5.1:_Response_of_a_damped_oscillator&amp;action=history"/>
	<updated>2026-04-24T21:53:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://fbswiki.org/wiki/index.php?title=Figure_5.1:_Response_of_a_damped_oscillator&amp;diff=1275&amp;oldid=prev</id>
		<title>Murray at 18:47, 16 November 2024</title>
		<link rel="alternate" type="text/html" href="http://fbswiki.org/wiki/index.php?title=Figure_5.1:_Response_of_a_damped_oscillator&amp;diff=1275&amp;oldid=prev"/>
		<updated>2024-11-16T18:47:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:47, 16 November 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot; &gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     m, b, k = params['m'], params['b'], params['k']&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     m, b, k = params['m'], params['b'], params['k']&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     return np.array([x[1], -k/m * x[0] - b/m * x[1]])&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     return np.array([x[1], -k/m * x[0] - b/m * x[1]])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;damposc = ct.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;NonlinearIOSystem&lt;/del&gt;(damposc_update, params=damposc_params)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;damposc = ct.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;nlsys&lt;/ins&gt;(damposc_update, params=damposc_params)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Simulate the response&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Simulate the response&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Murray</name></author>
	</entry>
	<entry>
		<id>http://fbswiki.org/wiki/index.php?title=Figure_5.1:_Response_of_a_damped_oscillator&amp;diff=1030&amp;oldid=prev</id>
		<title>Murray: Created page with &quot;{{Figure |Chapter=Dynamic Behavior |Figure number=5.1 |Sort key=501 |Figure title=Response of the damped oscillator to the initial condition x0 = (1, 0). |GitHub URL=https://g...&quot;</title>
		<link rel="alternate" type="text/html" href="http://fbswiki.org/wiki/index.php?title=Figure_5.1:_Response_of_a_damped_oscillator&amp;diff=1030&amp;oldid=prev"/>
		<updated>2024-01-01T00:56:14Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Figure |Chapter=Dynamic Behavior |Figure number=5.1 |Sort key=501 |Figure title=Response of the damped oscillator to the initial condition x0 = (1, 0). |GitHub URL=https://g...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Figure&lt;br /&gt;
|Chapter=Dynamic Behavior&lt;br /&gt;
|Figure number=5.1&lt;br /&gt;
|Sort key=501&lt;br /&gt;
|Figure title=Response of the damped oscillator to the initial condition x0 = (1, 0).&lt;br /&gt;
|GitHub URL=https://github.com/murrayrm/fbs2e-python/blob/main/figure-5.1-damposc_response.py&lt;br /&gt;
}}&lt;br /&gt;
[[Image:figure-5-1-damposc_response-time.png]]&lt;br /&gt;
&lt;br /&gt;
'''Figure 5.1''': Response of the damped oscillator to the initial condition x0 = (1, 0). The solution is unique for the given initial conditions and consists of an oscillatory solution for each state, with an exponentially decaying magnitude.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# damposc_response.py - dampled oscillator response&lt;br /&gt;
# RMM, 28 May 2023&lt;br /&gt;
&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
import numpy as np&lt;br /&gt;
import control as ct&lt;br /&gt;
import fbs                      # FBS plotting customizations&lt;br /&gt;
&lt;br /&gt;
# Oscillator parameters&lt;br /&gt;
damposc_params = {'m': 1, 'b': 0.2, 'k': 1}&lt;br /&gt;
&lt;br /&gt;
# System model (as ODE)&lt;br /&gt;
def damposc_update(t, x, u, params):&lt;br /&gt;
    m, b, k = params['m'], params['b'], params['k']&lt;br /&gt;
    return np.array([x[1], -k/m * x[0] - b/m * x[1]])&lt;br /&gt;
damposc = ct.NonlinearIOSystem(damposc_update, params=damposc_params)&lt;br /&gt;
&lt;br /&gt;
# Simulate the response&lt;br /&gt;
tvec = np.linspace(0, 20, 100)&lt;br /&gt;
response = ct.input_output_response(damposc, tvec, 0, X0=[1, 0])&lt;br /&gt;
&lt;br /&gt;
# Plot the states&lt;br /&gt;
fbs.figure('211')&lt;br /&gt;
plt.plot(response.time, response.states[0], 'b-')&lt;br /&gt;
plt.plot(response.time, response.states[1], 'b--')&lt;br /&gt;
plt.plot([response.time[0], response.time[-1]], [0, 0], 'k-', linewidth=0.75)&lt;br /&gt;
plt.xlabel('Time $t$ [s]')&lt;br /&gt;
plt.ylabel('States $x_1$, $x_2$')&lt;br /&gt;
plt.title(&lt;br /&gt;
    &amp;quot;Response of the damped oscillator to the initial condition x0 = (1, 0)&amp;quot;)&lt;br /&gt;
fbs.savefig('figure-5.1-damposc_response-time.png')&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Murray</name></author>
	</entry>
</feed>