Skip to content

Commit 19b38b7

Browse files
author
Documenter.jl
committed
build based on 2652dce
1 parent b4953b8 commit 19b38b7

File tree

17 files changed

+6320
-6086
lines changed

17 files changed

+6320
-6086
lines changed

dev/.documenter-siteinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-04T13:22:16","documenter_version":"1.7.0"}}
1+
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-04T13:52:55","documenter_version":"1.7.0"}}

dev/blocks/index.html

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

dev/examples/dc_motor_pi/49488e6f.svg renamed to dev/examples/dc_motor_pi/1f8e0416.svg

Lines changed: 63 additions & 63 deletions
Loading

dev/examples/dc_motor_pi/8823ce82.svg renamed to dev/examples/dc_motor_pi/76165afa.svg

Lines changed: 1635 additions & 1635 deletions
Loading

dev/examples/dc_motor_pi/1a12aef6.svg renamed to dev/examples/dc_motor_pi/7dc1bdba.svg

Lines changed: 56 additions & 56 deletions
Loading

dev/examples/dc_motor_pi/index.html

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

dev/examples/onoffcontroller/71f82d79.svg

Lines changed: 207 additions & 0 deletions
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>On-off controller · ModelingToolkitSampledData.jl</title><meta name="title" content="On-off controller · ModelingToolkitSampledData.jl"/><meta property="og:title" content="On-off controller · ModelingToolkitSampledData.jl"/><meta property="twitter:title" content="On-off controller · ModelingToolkitSampledData.jl"/><meta name="description" content="Documentation for ModelingToolkitSampledData.jl."/><meta property="og:description" content="Documentation for ModelingToolkitSampledData.jl."/><meta property="twitter:description" content="Documentation for ModelingToolkitSampledData.jl."/><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../search_index.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">ModelingToolkitSampledData.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../../">Home</a></li><li><span class="tocitem">Tutorials</span><ul><li><a class="tocitem" href="../../tutorials/SampledData/">Getting started with Sampled-Data Systems</a></li><li><a class="tocitem" href="../../tutorials/noise/">Noise and measurement corruption</a></li></ul></li><li><span class="tocitem">Examples</span><ul><li><a class="tocitem" href="../dc_motor_pi/">Controlled DC motor</a></li><li class="is-active"><a class="tocitem" href>On-off controller</a></li></ul></li><li><a class="tocitem" href="../../blocks/">Library API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Examples</a></li><li class="is-active"><a href>On-off controller</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>On-off controller</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/JuliaComputing/ModelingToolkitSampledData.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="On-off-controller"><a class="docs-heading-anchor" href="#On-off-controller">On-off controller</a><a id="On-off-controller-1"></a><a class="docs-heading-anchor-permalink" href="#On-off-controller" title="Permalink"></a></h1><p>A common form of controller is one which can output two distinct values only, such as on/off, or 1/-1. Below, we demonstrate the usage of such a controller, the <a href="../../blocks/#ModelingToolkitSampledData.DiscreteOnOffController"><code>DiscreteOnOffController</code></a>, and let it control an unstable first-order system. The system is given by the equation</p><p class="math-container">\[τ \dot x = x + 10u\]</p><p>where <span>$τ = 100$</span> is a time constant. The controller <span>$u = f(x)$</span> is an on/off controller with a hysteresis band of 0.3 and possible output values -1 and 1. The controller runs with an update frequency of 1 Hz.</p><pre><code class="language-julia hljs">using ModelingToolkit, ModelingToolkitSampledData, OrdinaryDiffEq, Plots
3+
using ModelingToolkit: t_nounits as t, D_nounits as D
4+
using ModelingToolkitStandardLibrary.Blocks
5+
using JuliaSimCompiler
6+
cl = Clock(1)
7+
z = ShiftIndex(cl)
8+
@mtkmodel OnOffModel begin
9+
@components begin
10+
onoff = DiscreteOnOffController(; b = 0.3, z, bool=false)
11+
c = Constant(k=1)
12+
end
13+
@variables begin
14+
x(t) = 0
15+
end
16+
@equations begin
17+
onoff.u ~ Sample(cl)(x)
18+
connect(c.output, onoff.reference)
19+
100D(x) ~ x + 10Hold(onoff.y)
20+
end
21+
end
22+
@named m = OnOffModel()
23+
m = complete(m)
24+
ssys = structural_simplify(IRSystem(m))
25+
prob = ODEProblem(ssys, [m.onoff.y(z-1) =&gt; 0], (0.0, 40.0))
26+
sol = solve(prob, Tsit5(), dtmax=0.1)
27+
plot(sol, idxs=[m.x, m.onoff.y], title=&quot;On-off control of an unstable first-order system&quot;)</code></pre><img src="71f82d79.svg" alt="Example block output"/><p>The parameter <code>b</code> controls the width of the hysteresis band, and the structural parameter <code>bool = false</code> indicates that this is a 1/-1 controller and not a 0/1 controller. The controller additionally takes a parameter <code>k</code> which is the gain of the controller, here we used the default <code>k = 1</code>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../dc_motor_pi/">« Controlled DC motor</a><a class="docs-footer-nextpage" href="../../blocks/">Library API »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Wednesday 4 September 2024 13:52">Wednesday 4 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

dev/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dev/objects.inv

35 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)