-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
618d4cc
commit 0ed1138
Showing
3 changed files
with
186 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 49, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/latex": [ | ||
"$$ \\begin{equation}\n", | ||
"\\left[\n", | ||
"\\begin{array}{c}\n", | ||
"f \\\\\n", | ||
"\\end{array}\n", | ||
"\\right]\n", | ||
"\\end{equation}\n", | ||
" $$" | ||
], | ||
"text/plain": [ | ||
"1-element Vector{Num}:\n", | ||
" f" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"using Symbolics\n", | ||
"\n", | ||
"\n", | ||
"@variables x₁ x₂ x₃\n", | ||
"@variables ∂₁ ∂₂ ∂₃\n", | ||
"@variables ΔX₁ ΔX₂ ΔX₃\n", | ||
"#@variables f(..)\n", | ||
"@variables f\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 56, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"q += p = f + ΔX₁*∂₁ + ΔX₂*∂₂ + ΔX₃*∂₂\n" | ||
] | ||
}, | ||
{ | ||
"ename": "ErrorException", | ||
"evalue": "syntax: invalid iteration specification", | ||
"output_type": "error", | ||
"traceback": [ | ||
"syntax: invalid iteration specification\n", | ||
"\n", | ||
"Stacktrace:\n", | ||
" [1] top-level scope\n", | ||
" @ ~/Github/SeismicQ/misc/FDCoeff.ipynb:9" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"q =f\n", | ||
"ordre = 2 # bigger than 2\n", | ||
"p = ∂₁ * ΔX₁ + ∂₂ * ΔX₂ + ∂₂ * ΔX₃\n", | ||
"q += p\n", | ||
"\n", | ||
"\n", | ||
"\n", | ||
"for m=2,ordre\n", | ||
" @show p *= 1//m * (∂₁ * ΔX₁ + ∂₂ * ΔX₂ + ∂₂ * ΔX₃)\n", | ||
" @show q += p\n", | ||
"\n", | ||
"end" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 35, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/latex": [ | ||
"$$ \\begin{equation}\n", | ||
"2 f\n", | ||
"\\end{equation}\n", | ||
" $$" | ||
], | ||
"text/plain": [ | ||
"2f" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"q = f+f" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Julia 1.9.2", | ||
"language": "julia", | ||
"name": "julia-1.9" | ||
}, | ||
"language_info": { | ||
"file_extension": ".jl", | ||
"mimetype": "application/julia", | ||
"name": "julia", | ||
"version": "1.9.2" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters