Skip to content

Commit

Permalink
- add back in removed images
Browse files Browse the repository at this point in the history
- fix image link paths
- use default github pages workflow from https://dotnet.github.io/docfx/
  • Loading branch information
Steinar Elgsæter committed Feb 22, 2024
1 parent 3c32ffd commit abbccb9
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 74 deletions.
74 changes: 35 additions & 39 deletions .github/workflows/docfx.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
name: docfx
on: [push]
on:
push:
branches:
- master
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
actions: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
name: Generate and publish the docs
outputs:
output1: ${{ steps.artifact-upload-step.outputs.artifact-id }}
steps:
- uses: actions/checkout@v1
name: Checkout code
- uses: nunit/docfx-action@v2.4.0
name: Build Documentation
- name: Checkout
uses: actions/checkout@v3
- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
args: docfx.json
- uses: actions/upload-artifact@v4
with:
name: github-pages
path: docs # describes what to upload
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
actions: read # to read the artifact made by build
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
dotnet-version: 8.x

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
- run: dotnet tool update -g docfx
- run: docfx docs/docfx.json

runs-on: ubuntu-latest
steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4
# with:
# artifact_name: ${{needs.build.outputs.output1}}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/upload-pages-artifact@v3
with:
name: github-pages.zip
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'docs/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
10 changes: 5 additions & 5 deletions docs/dynsim.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ where subsystem has has

A standard PID-control loop can be implemented as a subsystem:

![PID-subprocess](./../images/fig_pidprocess.png)
![PID-subprocess](/images/fig_pidprocess.png)

or it can simply be a single-input or multiple input to single output process model *without* feedback:

![nonPID-subprocess](./../images/fig_nonpidprocess.png).
![nonPID-subprocess](/images/fig_nonpidprocess.png).



The aim of the dynamic simulation is to support dynamic simulation of entire *process* sections.
A process is in general any set of subprocesses

![Process](./../images/fig_process.png)
![Process](/images/fig_process.png)

The point of co-simulating set of subprocesses is that they may be connected for instance

- subprocesses connected in series

![Process](./../images/fig_serialprocesses.png)
![Process](/images/fig_serialprocesses.png)

- subprocesses that are connected in process-feedback loops

![Process](./../images/fig_feedbackprocesses.png)
![Process](/images/fig_feedbackprocesses.png)

- subprocesses that are controlled by PID-controllers, and

Expand Down
2 changes: 1 addition & 1 deletion docs/ex_filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ In the top plot ``y`` that is two sinusoids overlayed.
The below plot shows the high pass- and low pass-filtered versions of ``y`` and by the naked eye you can see that
the filters have approximately managed to capture and separate out the two components.

![Example 3](./../images/ex3_filters.png)
![Example 3](/images/ex3_filters.png)


> [!Note]
Expand Down
4 changes: 2 additions & 2 deletions docs/ex_linreg.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ The code:

The dataset :

![Example 2 dataset](./../images/ex2_linreg_data.png)
![Example 2 dataset](/images/ex2_linreg_data.png)

> [!Note]
> The above is an example of how to plot time-series on multiple y-axes, which is extremely useful to visualize
> input/output relationships.
The resulting modeled ``y_modelled`` compared to ``y``:

![Example 2 y](./../images/ex2_linreg_y.png)
![Example 2 y](/images/ex2_linreg_y.png)

The estimated parameters (rounded to three significant digits) returned are:
```
Expand Down
4 changes: 2 additions & 2 deletions docs/ex_pid.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

In this example, a step disturbance influences a linear subprocess that is controlled by a PID-controller toward a constant setpoint of ``y=50``, like depicted in the below figure:

![Example 5 result](./../images/fig_pidprocess.png)
![Example 5 result](/images/fig_pidprocess.png)

``SubProcessSimulator.CoSimulateProcessAndPID`` co-simulates a single PID-controller/processes combination such as this.

[!code-csharp[Examples](../TimeSeriesAnalysis.Tests/Examples/GettingStarted.cs?name=ex_5)]

The resulting dynamic simulation:
![Example 5 result](./../images/ex5_results.png)
![Example 5 result](/images/ex5_results.png)

Note that the PID-controller is able to bring the subprocess back to the setpoint despite the disturbance.
The initial fast response of the proportional term ``Kp`` is seen in the plot of ``u_pid``, followed by the gradual
Expand Down
4 changes: 2 additions & 2 deletions docs/ex_processsim.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ subprocess-models interacting. Simulation of these kinds of systems is done usin
To keep things familiar this example extends on the previous. The subprocess-model is extended to *two inputs*, one external input signal is added in
addition to the pid-signal input as shown below:

![Example 6](./../images/fig_ex6.png)
![Example 6](/images/fig_ex6.png)

The second output is given a gain of ``2`` by adding a second process
gain to ``modelParamters``:
Expand Down Expand Up @@ -68,7 +68,7 @@ The entire code:
[!code-csharp[Examples](../TimeSeriesAnalysis.Tests/Examples/GettingStarted.cs?name=ex_6)]

The resulting dynamic simulation:
![Example 6 result](./../images/ex6_results.png)
![Example 6 result](/images/ex6_results.png)

The effect of the disturbance step entering 1/4th of the way through the dataset and then being rejected is seen, and is in fact exactly like
in the previous example, but now a step change in the input is also seen half-way through the dataset.
Expand Down
6 changes: 3 additions & 3 deletions docs/ex_sysid.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ The code to create the dataset, do the identification and create the plots is sh

The first plot shows the dataset, showing inputs``u1``, ``u2`` and output ``y``:

![Example 4:dataset](./../images/ex4_dataset.png)
![Example 4:dataset](/images/ex4_dataset.png)

**Notice of the time-delay and time-constant are clearly visible in this dataset**.
The resulting fit between model and dataset is shown below. The two time-series are virtually identical, except that
the modeled output does not have any noise.

![Example 4:output](./../images/ex4_results.png)
![Example 4:output](/images/ex4_results.png)

The resulting console output gives more detail on the parameters found:

Expand Down Expand Up @@ -76,7 +76,7 @@ Console.WriteLine("static model gains:" + Vec.ToString(regResults.Gains,3));
```
The resulting plot, which compares the dynamic and static models is shown below:

![Example 4:output](./../images/ex4_statvsdyn.png)
![Example 4:output](/images/ex4_statvsdyn.png)

The model gains of the static model is ``[0.69;1.29]``, which is not quite as close as
the estimate ``[0.958;1.96]`` of the dynamic identification to the true values: ``[1;2]``.
Expand Down
6 changes: 3 additions & 3 deletions docs/pid_cascade.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ and a slower outer loop(``process2`` and ``pid2``), both being subjected to simu
(In a real-world case, the inner loop of a cascade is often a (rapid) valve flow-rate controller,
while the outer loop could for instance be a level that depends on the flow rate.)

![Cascade system](./../images/ex_cascade.png)
![Cascade system](/images/ex_cascade.png)

A sinusoidal disturbance ``D1`` is introduced on process1, wheras a step disturbance is introduced halfway through
the simulation in ``D2``, and the aim is for the cascade controllers to reject both disturbances as well as possible.
Expand All @@ -15,7 +15,7 @@ The code to implement the controllers:

The resulting results.

![Cascade system](./../images/ex_cascade_results.png)
![Cascade system](/images/ex_cascade_results.png)


To observe the open-loop behavior of the system for the same disturbances but with both controllers in **manual mode**,
Expand All @@ -30,7 +30,7 @@ comment in the code lines:
```

The resulting open-loop simulation results:
![Cascade system](./../images/ex_cascade_open_loop_results.png)
![Cascade system](/images/ex_cascade_open_loop_results.png)

These simualtions show the benefits of the cascade control over open-loop:
- transients in ``y2`` of ``+/-0.5``, are reduced to approximiately ``+/-0.1``, and
Expand Down
6 changes: 3 additions & 3 deletions docs/pid_feedforward.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Feedforward control

![pid-feedforward](./images/pid_feedforward.png).
![pid-feedforward](/images/pid_feedforward.png).


## Simulating pid-control against an external disturbance *without* feed-forward
Expand All @@ -12,7 +12,7 @@ offset in ``y``, it falls to about ``y=46.5`` at its lowest.

[!code-csharp[Example](../TimeSeriesAnalysis.Tests/Examples/ProcessControl.cs?name=Feedforward_Part1)]

![Example 5 result](./../images/ex_feedforward_part1.png)
![Example 5 result](/images/ex_feedforward_part1.png)



Expand All @@ -29,4 +29,4 @@ with ``y`` falling to just `` y=50.4`` at its lowest, but at the expense of a sl

[!code-csharp[Example](../TimeSeriesAnalysis.Tests/Examples/ProcessControl.cs?name=Feedforward_Part2)]

![Example 5 result](./../images/ex_feedforward_part2.png)
![Example 5 result](/images/ex_feedforward_part2.png)
6 changes: 3 additions & 3 deletions docs/pid_gainscheduling.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ gain is *high*, and a second at a high value of the input, where the gain is *lo

The resulting plot is shown below:

![Example 5 result](./../images/ex_gainscheduling_part1.png)
![Example 5 result](/images/ex_gainscheduling_part1.png)

## Simulating the use of two standard PID-controllers
[!code-csharp[Example](../TimeSeriesAnalysis.Tests/Examples/ProcessControl.cs?name=GainScheduling_Part2)]


The resulting plot is shown below:
![Example 5 result](./../images/ex_gainscheduling_part2.png)
![Example 5 result](/images/ex_gainscheduling_part2.png)

> [!Note]
> In order to get an approximately equally rapid disturbacne rejection at setpoint ``y=70``
Expand All @@ -43,7 +43,7 @@ The code to create the gain-scheduling controller and simulate both runs:
[!code-csharp[Example](../TimeSeriesAnalysis.Tests/Examples/ProcessControl.cs?name=GainScheduling_Part3)]

The resulting plot is shown below:
![Example 5 result](./../images/ex_gainscheduling_part3.png)
![Example 5 result](/images/ex_gainscheduling_part3.png)

> [!Note]
> Notice how in the final plot, the gain-scheduling controller combines the control performance
Expand Down
2 changes: 1 addition & 1 deletion docs/pid_select.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ The two controllers in this kind of configuration have different *setpoints*, di
The output ``Y`` could for instance be the level in the tank, and the input ``U`` could be the opening of the gas outlet, one strategy to avoid liquid carryover could be to have this valve close more if a slug arrives.


![pid-tracking](./../images/ex_minselect.png).
![pid-tracking](/images/ex_minselect.png).

[!code-csharp[Example](../TimeSeriesAnalysis.Tests/Examples/ProcessControl.cs?name=MinSelect)]
6 changes: 1 addition & 5 deletions docs/plot_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ If running IIS,

The "physical path" is where you need to link in the "plotly" folder.

![IIS](./../images/IIS_setup.png)




![IIS](/images/IIS_setup.png)


### Serving up the "plotly" folder
Expand Down
8 changes: 4 additions & 4 deletions docs/sysid_disturbance.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ Counter-acting disturbances are the very reason that feedback controllers are us
observe the deviation between setpoint and measurement of the plant output, and change
one-or more inputs to counter-act the disturbance.

![System definitions](./../images/sysid_disturbance_system.png)
![System definitions](/images/sysid_disturbance_system.png)

### Example: step disturbance

Consider a step disturbance acting on a system without feedback

![ex1](./../images/sysid_disturbance_ex1.png)
![ex1](/images/sysid_disturbance_ex1.png)

The feedback is directly fed through to the output, while the input is constant.

Now consider and compare the same step disturbance, but this time a PID-controller counter-acts the disturbance

![ex1](./../images/sysid_disturbance_ex2.png)
![ex1](/images/sysid_disturbance_ex2.png)

The disturbance initally appears on the system output, then is slowly counter-acted by change of the manipulated
variable ``u`` by feedback control, thus moving the effect of the disturbance from the output ``y`` to the
Expand All @@ -29,7 +29,7 @@ Observing the offset between setpoint and measurement gives a *"high-frequency"*
first, while the change in ``u`` is gradual and *"low-frequency"* ``d_LF`` and the approach
will attempt to combine the two as shown below

![ex3](./../images/sysid_disturbance_ex3.png)
![ex3](/images/sysid_disturbance_ex3.png)

*The aim of this section is to develop an algorithm to estimate the the un-meausred disturbance ``d``
indirectly based on the measured ``u`` and ``e``*
Expand Down
2 changes: 1 addition & 1 deletion docs/sysid_ex_nonlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ simulated and plotted for comparison purposes. The significant difference betwee

The resulting figure, containing the dataset, the fitted model and the reference linear model.

![Example](./../images/sysid_ex_nonlin1.png)
![Example](/images/sysid_ex_nonlin1.png)

The output of ``idModel.ToString()`` gives details on the model:
```
Expand Down

0 comments on commit abbccb9

Please sign in to comment.