Skip to content

Commit

Permalink
Consolidate down a couple articles
Browse files Browse the repository at this point in the history
Add the notes on Observability in control theory practice talk to the Bae article, and note how cool she is.
Add some notes to the bicycling readme. Not a whole lot though.
Finally consolidate the meta/setup.md and meta/duplicating.md articles.
Update the tooling page with validation tooling.
  • Loading branch information
younata committed Nov 16, 2021
1 parent 12abc97 commit 3444f90
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 107 deletions.
10 changes: 10 additions & 0 deletions .spelling
Expand Up @@ -508,6 +508,8 @@ book.toml
- src/meta/setup.md
html-proofer
rsync
SUMMARY.md
book.toml
- src/programming/ci/concourse.md
Worker.beacon.forward
worker.sh
Expand Down Expand Up @@ -804,3 +806,11 @@ mdbook-section-validator
README.md
- src/programming/python/README.md
rspec-like
- src/bae/README.md
there'd
Cy
2y
ACACx
nfor
ly
GGyG
66 changes: 0 additions & 66 deletions src/bae/2019-07-17-observability-in-control-theory.md

This file was deleted.

73 changes: 72 additions & 1 deletion src/bae/README.md
@@ -1,3 +1,74 @@
# Bae

My bae is pretty great.
My bae is pretty great. As of this writing, she has a Masters in computer science, and is working on a PhD in robotics and electrical engineering. I have 3/4 of an undergrad computer science degree.

## Talk Practices

She sometimes gives talks, and she likes to practice for me. Sometimes I take notes on them. I rarely actually understand what she's talking about. But she's cute nonetheless.

### 2019-07-17 Observability in Control Theory

She practiced a talk on control theory in front of me. These are my notes. The talk content might be wrong - she's still learning about this.

E.G. Drone on top of a car, measuring the car.

It has a method to track the target (car). The way it does it is to measure the state of the target.

`x(t+1) = A * x(t)`

`A` is a transition matrix - it maps the target from the current state to the next (next state = current state * transition matrix)

Drone can measure the target's "process" - it can estimate the next state of the target because it has the transition matrix encoded in it.

Let's say drone also has some radar/camera sensors (other sensors).

Now, `y(t) = C * x(t)` - `y` is the drone's measurement of `x(t)`. C maps the current state to what the drone is observing.

This format is how we'd model dynamical system. Usually there'd be other terms for noise (B - process noise, D - measurement noise).

Given this system, the system is observable if given `y(0), y(1), ..., y(l)` if we can backtrack to a state `x(0)`

How to get from the measurements to the original state (get from `y(0), y(1), ...` to `x(0)). So, we know from `x(1) = A * x(0)`, and we know that `x(2) = A * x(1)` = `A^2 * x(0)`. Therefore, `x(l) = A^l * x(0)`

Similarly, `y(0) = C * x(0)` and `y(1) = C * x(1) = C * A * x(0)`, and so forth: `y(l) = C*A^l*x(0)`. This can then be rewritten as a system of linear equations, like so:

| y | observability matrix |
|--------|--------|
| `y(0)` | `C` |
| `y(1)` | `CA` |
| `y(2)` | `CA^2` |
| ... | ... |
| `y(l)` | `CA^l` |

Can then be solved for `x(0)` if we have `A` and `C`. So, we could write this out if we have matrices `A` and `C`, but it's a long matrix, so it'd be difficult to compute.

How do we know that this is observible if it's computationally hard to get to a unique `x(0)`

So, this can be written as:

`y\_bar = O * x(0)` (O = observability matrix). If the `rank(O) == n` (rank = number of columns, n = number of states that target can be in), then the system is observable.

Doesn't tell you how observable it is, or how much information you need in order to get to x(0) - it could be observable, but it might be infeasible to observe.

#### Measuring Observability

So, measuring observability:

Observability gramiam - different kind of matrix that is used to tell how observable a system is.

`for all t from 0 to l`, the normal of `y(t)` squared = energy of `y` = the observability gramiam. The higher, the more observable.
`= sum from 0 to l of transposed(C * A ^ t * x(0)) * (C * A ^ t * x(0))` = `G`.

If we take determinant of `G`, and is high, then we have high energy in `y`, and it's highly observable.

want to maximize the minimum eigenvalues of `G`, in order to have high observability.

These are all ways to say how observable a system is.

#### Usefulness

Why do this?

You can use this information to calculate how well a kalman filter works by calculating the observability gramiam.

You can determine how well you designed your system.
2 changes: 2 additions & 0 deletions src/bicycling/README.md
@@ -1 +1,3 @@
# Bicycling

Bicycling is one of the best forms of ground transportation.
38 changes: 0 additions & 38 deletions src/meta/duplicating.md

This file was deleted.

46 changes: 44 additions & 2 deletions src/meta/setup.md
Expand Up @@ -2,7 +2,7 @@

This is setup using [mdBook](https://github.com/rust-lang-nursery/mdBook). It's hosted as a [repository on github](https://github.com/younata/personal_knowledge). I set up a pipeline in [concourse](https://concourse-ci.org) to build, check that things work, and then push new versions once things are set up.

[TL;DR, check out these instructions](duplicating.md)
[TL;DR, check out these instructions at the bottom](#duplicating)

## Repository Layout

Expand Down Expand Up @@ -53,7 +53,49 @@ mdspell --ignore-acronyms --ignore-numbers --en-us "**/*.md"
## Future Work

- On a per-section basis, add other lines to show up for all pages in that section (e.g. I want everything in my [flying](../flying/) section to have the "This is for my own use and is not flight instruction" disclaimer).
- Figure out a way to actually support checkboxes and such, as how github does. This could be done as a custom preprocessor.

## Duplicating

Here's what I did to stand up additional versions of this repository (e.g. a separate one for work, the [coz-e build](https://coz-e.rachelbrindle.com)).

### Machine Setup

[mdBook](https://github.com/rust-lang-nursery/mdBook) requires rust to use, so we first install rust. This is done via [rustup](https://rustup.rs).

- `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`

Next, we install mdbook itself: `cargo install mdbook`.

Additionally, there's a bunch of [extra tooling I use]({{#path_for tooling}}). I won't go through them in detail, but here's the following commands to install everything:

```bash
cargo install mdbook-generate-summary mdbook-api mdbook-chapter-path mdbook-git-atom mdbook-section-validator
```

This is all that's required to setup the machine.

You can optionally install the validation tooling (markdown-spellcheck, html-proofer) with the following commands:

```bash
npm i -g markdown-spellcheck
gem install html-proofer
```

### Setting up the Repository

To set up the repository itself, you need to create a `book.toml` file, an initial `src/README.md` file, and (if not using `mdbook-generate-summary`) a `src/SUMMARY.md` file.

For reference, this repository's book.toml file is:

```toml
{{#include ../../book.toml}}
```

### Building the Repository

If you want to view the repository locally, you can use `mdbook build`, and open `book/index.html` in your web browser. If you're doing interactive work, then you can use `mdbook watch`.

Note that if you're using `mdbook-generate-summary`, you should run that every time you create, delete, or move a page.

[^pipeline]: The pipeline definition looks like this:

Expand Down
34 changes: 34 additions & 0 deletions src/meta/tooling.md
Expand Up @@ -34,3 +34,37 @@ Because this is written as an mdbook postprocessor, it does mean that this check

It has some rough edges. For example, if you don't give each directory a README.md file (with the name of the section), then the generated `SUMMARY.md` file will not be correctly organized. But, it works well enough for my use case, so long as I keep that limitation in mind.
!!!

### Last-updated Annotations

This is simply a script that runs in CI which appends the date of the commit that last updated the file, which has the following contents:

```bash
{{#include ../../scripts/annotate_dates.sh}}
```

### Spellcheck

I use the [markdown-spellcheck](https://www.npmjs.com/package/markdown-spellcheck?activeTab=readme) package to spellcheck all the markdown files.

### HTML-Proofer

In CI, I use the [html-proofer](https://github.com/gjtorikian/html-proofer) gem to validate the generated html of this project. The command looks like:

```bash
DOMAIN="https://knowledge.rachelbrindle.com"
FILE_IGNORES="./print.html,./404.html" # Ignore the 404 page and especially the print page. Print page is simply a all pages consolidated, and it's better to catch broken links as close to the original file as possible
URL_IGNORES: "/github.com\\/younata\\/personal_knowledge/" # Don't error if a link to a not-yet-there file is published.

/usr/local/bundle/bin/htmlproofer \
--assume-extension \
--check-img-http \
--enforce-https \
--only_4xx \
--http-status-ignore "401,402,403,415" \
--file-ignore "$FILE_IGNORES" \
--url-ignore "$URL_IGNORES" \
--internal-domains "$DOMAIN" "./book/html"
```

Which is why, if you view source, all of the links to `http` sites have the `data-proofer-ignore` attribute in their anchor tag.

0 comments on commit 3444f90

Please sign in to comment.