Skip to content

Commit e9ba6b5

Browse files
Merge pull request #57 from ChrisRackauckas-Claude/docs-improvements-20260107-172836
Documentation improvements: Fix typos, bugs, and inconsistencies
2 parents c7c68f6 + 9c36f1b commit e9ba6b5

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ make sure that `julia` is found in the path. For more
3535
information see the `julia_setup()` function from
3636
[JuliaCall](https://github.com/JuliaInterop/JuliaCall).
3737

38-
## Google Collab Notebooks
38+
## Google Colab Notebooks
3939

4040
As a demonstration, check out the following notebooks:
4141

@@ -162,7 +162,7 @@ Plotly is much prettier!
162162

163163
If we want to have a more accurate solution, we can send `abstol` and `reltol`. Defaults are `1e-6` and `1e-3` respectively.
164164
Generally you can think of the digits of accuracy as related to 1 plus the exponent of the relative tolerance, so the default is
165-
two digits of accuracy. Absolute tolernace is the accuracy near 0.
165+
two digits of accuracy. Absolute tolerance is the accuracy near 0.
166166

167167
In addition, we may want to choose to save at more time points. We do this by giving an array of values to save at as `saveat`.
168168
Together, this looks like:
@@ -458,7 +458,7 @@ tspan <- c(0.0, 100.0)
458458
constant_lags <- c(20.0)
459459
JuliaCall::julia_assign("u0", u0)
460460
JuliaCall::julia_assign("tspan", tspan)
461-
JuliaCall::julia_assign("constant_lags", tspan)
461+
JuliaCall::julia_assign("constant_lags", constant_lags)
462462
prob <- JuliaCall::julia_eval("DDEProblem(f, u0, h, tspan, constant_lags = constant_lags)")
463463
sol <- de$solve(prob,de$MethodOfSteps(de$Tsit5()))
464464
udf <- as.data.frame(t(sapply(sol$u,identity)))

vignettes/dae.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ differential_vars <- c(TRUE,TRUE,FALSE)
3939
prob <- de$DAEProblem(f,du0,u0,tspan,differential_vars=differential_vars)
4040
sol <- de$solve(prob)
4141
udf <- as.data.frame(t(sapply(sol$u,identity)))
42-
plotly::plot_ly(udf, x = sol$t, y = ~V1, type = 'scatter', mode = 'lines') %>%
43-
plotly::add_trace(y = ~V2) %>%
42+
plotly::plot_ly(udf, x = sol$t, y = ~V1, type = 'scatter', mode = 'lines') |>
43+
plotly::add_trace(y = ~V2) |>
4444
plotly::add_trace(y = ~V3)
4545
```
4646

vignettes/dde.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ tspan <- c(0.0, 100.0)
3939
constant_lags <- c(20.0)
4040
JuliaCall::julia_assign("u0", u0)
4141
JuliaCall::julia_assign("tspan", tspan)
42-
JuliaCall::julia_assign("constant_lags", tspan)
42+
JuliaCall::julia_assign("constant_lags", constant_lags)
4343
prob <- JuliaCall::julia_eval("DDEProblem(f, u0, h, tspan, constant_lags = constant_lags)")
4444
sol <- de$solve(prob,de$MethodOfSteps(de$Tsit5()))
4545
udf <- as.data.frame(t(sapply(sol$u,identity)))
46-
plotly::plot_ly(udf, x = sol$t, y = ~V1, type = 'scatter', mode = 'lines') %>% plotly::add_trace(y = ~V2)
46+
plotly::plot_ly(udf, x = sol$t, y = ~V1, type = 'scatter', mode = 'lines') |> plotly::add_trace(y = ~V2)
4747
```
4848

4949
![delay](https://user-images.githubusercontent.com/1814174/39023532-10bdd750-43f0-11e8-837d-156d33ea2f99.png)

vignettes/ode.Rmd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ This gives back a solution object for which `sol$t` are the time points
5050
and `sol$u` are the values. We can treat the solution as a continuous object
5151
in time via
5252

53+
```R
54+
sol$.(0.2)
55+
```
56+
5357
and a high order interpolation will compute the value at `t=0.2`. We can check
5458
the solution by plotting it:
5559

@@ -77,7 +81,7 @@ Here we utilized the parameter array `p`. Thus we use `diffeqr::ode.solve` like
7781

7882
```R
7983
u0 <- c(1.0,0.0,0.0)
80-
tspan <- list(0.0,100.0)
84+
tspan <- c(0.0,100.0)
8185
p <- c(10.0,28.0,8/3)
8286
prob <- de$ODEProblem(f, u0, tspan, p)
8387
sol <- de$solve(prob)

vignettes/sde.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ g <- function(u,p,t) {
3030
return(0.87*u)
3131
}
3232
u0 <- 1/2
33-
tspan <- list(0.0,1.0)
33+
tspan <- c(0.0,1.0)
3434
prob <- de$SDEProblem(f,g,u0,tspan)
3535
sol <- de$solve(prob)
3636
udf <- as.data.frame(t(sapply(sol$u,identity)))

0 commit comments

Comments
 (0)