make pdf file generation work
This commit is contained in:
@@ -234,14 +234,14 @@ The extra step is to specify a "`NonlinearSystem`." It is a system, as in practi
|
||||
|
||||
|
||||
```{julia}
|
||||
ns = NonlinearSystem([eq], [x], [α], name=:ns)
|
||||
ns = NonlinearSystem([eq], [x], [α], name=:ns);
|
||||
```
|
||||
|
||||
The `name` argument is special. The name of the object (`ns`) is assigned through `=`, but the system must also know this same name. However, the name on the left is not known when the name on the right is needed, so it is up to the user to keep them synchronized. The `@named` macro handles this behind the scenes by simply rewriting the syntax of the assignment:
|
||||
|
||||
|
||||
```{julia}
|
||||
@named ns = NonlinearSystem([eq], [x], [α])
|
||||
@named ns = NonlinearSystem([eq], [x], [α]);
|
||||
```
|
||||
|
||||
With the system defined, we can pass this to `NonlinearProblem`, as was done with a function. The parameter is specified here, and in this case is `α => 1.0`. The initial guess is `[1.0]`:
|
||||
@@ -365,7 +365,7 @@ The above should be self explanatory. To put into a form to pass to `solve` we d
|
||||
|
||||
|
||||
```{julia}
|
||||
@named sys = OptimizationSystem(Area, [x], [P])
|
||||
@named sys = OptimizationSystem(Area, [x], [P]);
|
||||
```
|
||||
|
||||
(This step is different, as before an `OptimizationFunction` was defined; we use `@named`, as above, to ensure the system has the same name as the identifier, `sys`.)
|
||||
@@ -409,7 +409,7 @@ could be similarly approached:
|
||||
@variables x
|
||||
y = Area/x # from A = xy
|
||||
P = 2x + 2y
|
||||
@named sys = OptimizationSystem(P, [x], [Area])
|
||||
@named sys = OptimizationSystem(P, [x], [Area]);
|
||||
|
||||
u0 = [x => 4.0]
|
||||
p = [Area => 25.0]
|
||||
@@ -570,14 +570,12 @@ As well, suppose we wanted to parameterize our function and then differentiate.
|
||||
Consider $d/dp \int_0^\pi \sin(px) dx$. We can do this integral directly to get
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\frac{d}{dp} \int_0^\pi \sin(px)dx
|
||||
&= \frac{d}{dp}\left( \frac{-1}{p} \cos(px)\Big\rvert_0^\pi\right)\\
|
||||
&= \frac{d}{dp}\left( -\frac{\cos(p\cdot\pi)-1}{p}\right)\\
|
||||
&= \frac{\cos(p\cdot \pi) - 1)}{p^2} + \frac{\pi\cdot\sin(p\cdot\pi)}{p}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Using `Integrals` with `QuadGK` we have:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user