Merge branch 'main' into v0.18
This commit is contained in:
commit
90e068f739
@ -16,7 +16,7 @@ using ModelingToolkit
|
||||
---
|
||||
|
||||
|
||||
The [`DifferentialEquations`](https://github.com/SciML/DifferentialEquations.jl) suite of packages contains solvers for a wide range of various differential equations. This section just briefly touches touch on ordinary differential equations (ODEs), and so relies only on `OrdinaryDiffEq` part of the suite. For more detail on this type and many others covered by the suite of packages, there are many other resources, including the [documentation](https://diffeq.sciml.ai/stable/) and accompanying [tutorials](https://github.com/SciML/SciMLTutorials.jl).
|
||||
The [`DifferentialEquations`](https://github.com/SciML/DifferentialEquations.jl) suite of packages contains solvers for a wide range of various differential equations. This section just briefly touches on ordinary differential equations (ODEs), and so relies only on `OrdinaryDiffEq` part of the suite. For more detail on this type and many others covered by the suite of packages, there are many other resources, including the [documentation](https://diffeq.sciml.ai/stable/) and accompanying [tutorials](https://github.com/SciML/SciMLTutorials.jl).
|
||||
|
||||
|
||||
## SIR Model
|
||||
@ -266,7 +266,7 @@ $$
|
||||
\frac{di}{ds} = \frac{di/dt}{ds/dt} = \frac{b \cdot s(t) \cdot i(t) - k \cdot i(t)}{-b \cdot s(t) \cdot i(t)} = -1 + \frac{1}{c \cdot s}
|
||||
$$
|
||||
|
||||
This equation does not depend on $t$; $s$ is the dependent variable. It could be solved numerically, but in this case affords an algebraic solution: $i = -s + (1/c) \log(s) + q$, where $q$ is some constant. The quantity $q = i + s - (1/c) \log(s)$ does not depend on time, so is the same at time $t=0$ as it is as $t \rightarrow \infty$. At $t=0$ we have $s(0) \approx 1$ and $i(0) \approx 0$, whereas $t \rightarrow \infty$, $i(t) \rightarrow 0$ and $s(t)$ goes to the steady state value, which can be estimated. Solving with $t=0$, we see $q=0 + 1 - (1/c)\log(1) = 1$. In the limit them $1 = 0 + s_{\infty} - (1/c)\log(s_\infty)$ or $c = \log(s_\infty)/(1-s_\infty)$.
|
||||
This equation does not depend on $t$; $s$ is the dependent variable. It could be solved numerically, but in this case affords an algebraic solution: $i = -s + (1/c) \log(s) + q$, where $q$ is some constant. The quantity $q = i + s - (1/c) \log(s)$ does not depend on time, so is the same at time $t=0$ as it is as $t \rightarrow \infty$. At $t=0$ we have $s(0) \approx 1$ and $i(0) \approx 0$, whereas $t \rightarrow \infty$, $i(t) \rightarrow 0$ and $s(t)$ goes to the steady state value, which can be estimated. Solving with $t=0$, we see $q=0 + 1 - (1/c)\log(1) = 1$. In the limit then $1 = 0 + s_{\infty} - (1/c)\log(s_\infty)$ or $c = \log(s_\infty)/(s_\infty - 1)$.
|
||||
|
||||
|
||||
## Trajectory with drag
|
||||
|
@ -315,7 +315,7 @@ p
|
||||
As well, see this part of a [Wikipedia](http://en.wikipedia.org/wiki/Polar_coordinate_system#Integral_calculus_.28area.29) page for a figure.
|
||||
|
||||
|
||||
Imagine we have $a < b$ and a partition $a=t_0 < t_1 < \cdots < t_n = b$. Let $\phi_i = (1/2)(t_{i-1} + t_{i})$ be the midpoint. Then the wedge of radius $r(\phi_i)$ with angle between $t_{i-1}$ and $t_i$ will have area $\pi r(\phi_i)^2 (t_i-t_{i-1}) / (2\pi) = (1/2) r(\phi_i)(t_i-t_{i-1})$, the ratio $(t_i-t_{i-1}) / (2\pi)$ being the angle to the total angle of a circle. Summing the area of these wedges over the partition gives a Riemann sum approximation for the integral $(1/2)\int_a^b r(\theta)^2 d\theta$. This limit of this sum defines the area in polar coordinates.
|
||||
Imagine we have $a < b$ and a partition $a=t_0 < t_1 < \cdots < t_n = b$. Let $\phi_i = (1/2)(t_{i-1} + t_{i})$ be the midpoint. Then the wedge of radius $r(\phi_i)$ with angle between $t_{i-1}$ and $t_i$ will have area $\pi r(\phi_i)^2 (t_i-t_{i-1}) / (2\pi) = (1/2) r(\phi_i)^2(t_i-t_{i-1})$, the ratio $(t_i-t_{i-1}) / (2\pi)$ being the angle to the total angle of a circle. Summing the area of these wedges over the partition gives a Riemann sum approximation for the integral $(1/2)\int_a^b r(\theta)^2 d\theta$. This limit of this sum defines the area in polar coordinates.
|
||||
|
||||
|
||||
> *Area of polar regions*. Let $R$ denote the region bounded by the curve $r(\theta)$ and bounded by the rays $\theta=a$ and $\theta=b$ with $b-a \leq 2\pi$, then the area of $R$ is given by:
|
||||
@ -554,7 +554,7 @@ A point in Cartesian coordinates is given by $(-12, -5)$. In has a polar coordin
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
x,y = -12, -5
|
||||
r1, theta1 = sqrt(x^2 + y^2), atan(y,x)
|
||||
r1, theta1 = sqrt(x^2 + y^2), atan(y,x) + 2pi
|
||||
numericq(r1)
|
||||
```
|
||||
|
||||
@ -565,7 +565,7 @@ What is $\theta$?
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
x,y = -12, -5
|
||||
r1, theta1 = sqrt(x^2 + y^2), atan(y,x)
|
||||
r1, theta1 = sqrt(x^2 + y^2), atan(y,x) + 2pi
|
||||
numericq(theta1)
|
||||
```
|
||||
|
||||
@ -626,8 +626,8 @@ allows the slope to be computed when $y$ and $x$ are the Cartesian form of the p
|
||||
|
||||
|
||||
$$
|
||||
\frac{dy}{d\theta} = \frac{d}{d\theta}(2\cos(\theta) \cdot \cos(\theta)),~ \text{ and }
|
||||
\frac{dx}{d\theta} = \frac{d}{d\theta}(2\sin(\theta) \cdot \cos(\theta)).
|
||||
\frac{dy}{d\theta} = \frac{d}{d\theta}(2\sin(\theta) \cdot \cos(\theta)),~ \text{ and }
|
||||
\frac{dx}{d\theta} = \frac{d}{d\theta}(2\cos(\theta) \cdot \cos(\theta)).
|
||||
$$
|
||||
|
||||
Numerically, what is the slope of the tangent line when $\theta = \pi/4$?
|
||||
@ -637,8 +637,8 @@ Numerically, what is the slope of the tangent line when $\theta = \pi/4$?
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
r(theta) = 2cos(theta)
|
||||
g(theta) = r(theta)*cos(theta)
|
||||
f(theta) = r(theta)*sin(theta)
|
||||
g(theta) = r(theta)*sin(theta)
|
||||
f(theta) = r(theta)*cos(theta)
|
||||
c = pi/4
|
||||
val = D(g)(c) / D(f)(c)
|
||||
numericq(val)
|
||||
@ -729,7 +729,7 @@ radioq(choices, answ)
|
||||
###### Question
|
||||
|
||||
|
||||
Find the area of a lobe of the [eight](http://www-history.mcs.st-and.ac.uk/Curves/Eight.html) curve traced out by $r(\theta) = \cos(2\theta)\sec(\theta)^4$ from $-\pi/4$ to $\pi/4$. Do this numerically.
|
||||
Find the area of a lobe of the [eight](http://www-history.mcs.st-and.ac.uk/Curves/Eight.html) curve traced out by $r(\theta) = \sqrt{\cos(2\theta)\sec(\theta)^4}$ from $-\pi/4$ to $\pi/4$. Do this numerically.
|
||||
|
||||
|
||||
```{julia}
|
||||
@ -757,7 +757,7 @@ numericq(val)
|
||||
###### Question
|
||||
|
||||
|
||||
Find the arc length of a lobe of the [eight](http://www-history.mcs.st-and.ac.uk/Curves/Eight.html) curve traced out by $r(\theta) = \cos(2\theta)\sec(\theta)^4$ from $-\pi/4$ to $\pi/4$. Do this numerically.
|
||||
Find the arc length of a lobe of the [eight](http://www-history.mcs.st-and.ac.uk/Curves/Eight.html) curve traced out by $r(\theta) = \sqrt{\cos(2\theta)\sec(\theta)^4}$ from $-\pi/4$ to $\pi/4$. Do this numerically.
|
||||
|
||||
|
||||
```{julia}
|
||||
|
Loading…
x
Reference in New Issue
Block a user