add CI action; rm stale files

This commit is contained in:
jverzani
2022-09-08 07:03:08 -04:00
parent 0db8896554
commit ba14dd8548
682 changed files with 573037 additions and 8 deletions

View File

@@ -1,11 +1,18 @@
---
format:
html:
header-includes: |
<script src="https://cdn.plot.ly/plotly-2.11.0.min.js"></script>
---
# JavaScript based plotting libraries
{{< include ../_common_code.qmd >}}
:::{.callout-note}
## Not working with quarto
Currently, the plots generated here are not rendering within quarto.
## Plotly and Quarto
There are some oddities working with `Plotly`, `Julia`, and Quarto that require some hand editing of an HTML file. If the images are not shown below, there was an oversight. A reported issue would be welcome.
:::
@@ -16,6 +23,12 @@ This section uses this add-on package:
using PlotlyLight
```
```{julia}
#| echo: false
PlotlyLight.src!(:none)
nothing
```
To avoid a dependence on the `CalculusWithJulia` package, we load two utility packages:
@@ -740,4 +753,3 @@ lyt = Config(scene=Config(aspectmode="data"))
Plot(data, lyt)
```

View File

@@ -254,6 +254,13 @@ ex = sin(x)
substitute(ex, x=>π), substitute(ex, x=>π, fold=false)
```
For the latter, it is more efficient to directly use `Term`, which creates the symbolic expression representing the calling of `sin(π)`:
```{julia}
Symbolics.Term(sin, [π])
```
### Simplify
@@ -467,6 +474,8 @@ r + sum(v*k for (k,v) ∈ d)
The above has `a,b,c` as parameters and `x` as the symbol. This separation is designated by passing the desired polynomial symbols to `polynomial_coeff` as an iterable. (Above as a $1$-element tuple.)
More complicated polynomials can be similarly decomposed:
@@ -530,6 +539,20 @@ To have a natural map between polynomials of a single symbol in the standard bas
vcat(r, [d[k] for k ∈ sort(collect(keys(d)), by=degree)])
```
As an example usage, we write a function that can determine if an expression is a polynomial expression over some specified variables.
```{julia}
function is_poly(expr, vars)
all(Symbolics.SymbolicUtils.issym ∘ Symbolics.value, vars) || error("vars must be an iterable of symbols")
p,r = polynomial_coeffs(expr, vars)
length(intersect(Symbolics.get_variables(r), vars)) == 0
end
is_poly(p, (x,))
```
---