-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: b0447c1d44c8bed488ca48d70a7cce9f | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Dynamic Exercises |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"#### Collocation Matrix" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"[\n", | ||
"[np.float64(-9.000001008080126), np.float64(-4.139388773624379), np.float64(1.7393879671602779), np.float64(-3.0000002520200333)],\n", | ||
"[np.float64(10.048810106494384), np.float64(3.2247461916839306), np.float64(-3.567840077120941), np.float64(5.531972415060627)],\n", | ||
"[np.float64(-1.382142403745367), np.float64(1.1678398419022438), np.float64(0.7752546483828548), np.float64(-7.53197233105394)],\n", | ||
"[np.float64(0.33333330533110994), np.float64(-0.25319725996179565), np.float64(1.0531974615778044), np.float64(5.000000168013341)],\n", | ||
"]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import numpy\n", | ||
"\n", | ||
"cp = [0, 0.155051, 0.644949, 1]\n", | ||
"\n", | ||
"a = []\n", | ||
"\n", | ||
"print('[')\n", | ||
"for i in range(len(cp)):\n", | ||
" ptmp = []\n", | ||
" tmp = 0\n", | ||
" for j in range(len(cp)):\n", | ||
" if j != i:\n", | ||
" row = []\n", | ||
" row.insert(0,1/(cp[i]-cp[j]))\n", | ||
" row.insert(1,-cp[j]/(cp[i]-cp[j]))\n", | ||
" ptmp.insert(tmp,row)\n", | ||
" tmp += 1\n", | ||
" p=[1]\n", | ||
" for j in range(len(cp)-1):\n", | ||
" p = numpy.convolve(p,ptmp[j])\n", | ||
" pder = numpy.polyder(p,1)\n", | ||
" arow = []\n", | ||
" for j in range(len(cp)):\n", | ||
" arow.append(numpy.polyval(pder,cp[j]))\n", | ||
" a.append(arow)\n", | ||
" print(str(arow)+',')\n", | ||
"print(']')" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": ".venv", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Large diffs are not rendered by default.