Skip to content

Commit

Permalink
Minor fix to phase 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Greenburg committed Nov 21, 2023
1 parent 47f1853 commit 19f8bc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions project/phase9.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ The self-contained [example code](https://github.com/BYUHPC/sci-comp-course-exam

### The Derivative Function

Defining the function that you'll pass to `SecondOrderODEProblem` itself isn't too bad, and `dhdt!` in the [example](https://github.com/BYUHPC/sci-comp-course-example-cxx/blob/main/src/initial.jl) offers some guidance. Notice that `dvdt!`'s main computation is just the [differential equation that defines the example problem](https://github.com/BYUHPC/sci-comp-course-example-cxx/tree/main#appendix-a-mathematical-justification)--you'll do something similar with the [damped wave equation differential equation](overview.md#appendix-c-mathematical-justification). Here's the gist:
Defining the function that you'll pass to `SecondOrderODEProblem` itself isn't too bad, and `dhdt!` in the [example](https://github.com/BYUHPC/sci-comp-course-example-cxx/blob/main/src/initial.jl) offers some guidance. Notice that `dhdt!`'s main computation is just the [differential equation that defines the example problem](https://github.com/BYUHPC/sci-comp-course-example-cxx/tree/main#appendix-a-mathematical-justification)--you'll do something similar with the [damped wave equation differential equation](overview.md#appendix-c-mathematical-justification). Here's the gist:

```julia
function dvdt!(a, v, u, c, t) # u: displacement; v: velocity; a: acceleration
a = laplacian(u) - c*v # this is just pseudo-code, it needs some fixing
a = laplacian(u) - c*v # just pseudo-code, needs significant overhaul
return nothing
end
```

Expand Down

0 comments on commit 19f8bc7

Please sign in to comment.