Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
9494ea0
Brian Nelson: Add all information to jupyter notebook for homework pr…
brnnelson4 Nov 25, 2020
90b78f1
Remove extra files
brnnelson4 Nov 25, 2020
5b9a5aa
Added Spencer Ammermon's lu factorization page
randybeard Nov 30, 2020
afd29b9
Jonathan Skaggs added t1_vector_spaces.ipynb
jbskaggs Dec 4, 2020
d3c8557
Updates to t6
sequoiap Dec 4, 2020
559e5ac
Merge pull request #9 from jbskaggs/master
randybeard Dec 5, 2020
3ec8356
Added projection onto arbitrary plane example
sequoiap Dec 6, 2020
6e28e38
Merge pull request #10 from sequoiap/master
randybeard Dec 7, 2020
4dc2b88
Merge pull request #8 from brnnelson4/recursive_least_sq
randybeard Dec 7, 2020
8def2a5
initial work and setup
curtiscjohnson Dec 7, 2020
a48af27
added power iteration section
curtiscjohnson Dec 8, 2020
8bfdcc9
added application homework problem to t27_gradient_descent
spencerwarrenj Dec 9, 2020
aada7ff
added application homework problem to t27_gradient_descent
spencerwarrenj Dec 9, 2020
95d5f37
got rid of random extra files
spencerwarrenj Dec 9, 2020
b271b6b
I'm Jen Jui Liu
re1983 Dec 9, 2020
14f069e
Added invariant subspaces notebook
49pctber Dec 9, 2020
50b478f
I updated the cholesky factorization page for my project. I added con…
jhunt92 Dec 9, 2020
53ef2b2
added challenge problem to orthonormal bases page and associated file…
bjacobm Dec 9, 2020
7e40490
adding my jupyter notebook project
atwitchell Dec 10, 2020
e70b566
adding my jupyter notebook project
atwitchell Dec 10, 2020
ad14ff3
added new page - t26 rank reduction for matrix approximation
aerialgraffics Dec 10, 2020
59992af
Added a HW problem to SVD page along with textrecognition-solution.py…
jknight2786 Dec 10, 2020
5d07e0c
Added modifications to Vector Norms
cjcarver Dec 10, 2020
06310ff
Reorganize, reword, and add sections on calculating the inverse and u…
Dec 10, 2020
3e64e3c
Added engineering example
dan-free Dec 10, 2020
b2052c9
cleanup and rewording
Dec 10, 2020
a6d1073
Add links, rewording
Dec 10, 2020
ddd7bb2
Changed from Spencer's version to the version I created, in case havi…
dan-free Dec 10, 2020
4c47e02
More rewording
Dec 10, 2020
df62f9e
Updating Linear Operators
ChrisWhetten Dec 10, 2020
5f9f1ed
Merge pull request #25 from ChrisWhetten/master
randybeard Dec 10, 2020
cf8d522
Merge pull request #24 from BillThePlatypus/master
randybeard Dec 10, 2020
2d2dff3
Jonathan Barrett's Jupyter Notebook Submission (Linear Regression)
jab128 Dec 10, 2020
8038792
Add files via upload
truchti Dec 10, 2020
c107c14
data
truchti Dec 10, 2020
697f7b1
Added a new intutive exmaple and code as well as physics application.
dispencer17 Dec 10, 2020
0155b64
final commit, added solution
curtiscjohnson Dec 10, 2020
be69536
commiting picture and some cool facts
curtiscjohnson Dec 10, 2020
2258c6c
Added my page on adjoint operators to the notebook.
cs574296 Dec 10, 2020
c95e184
Merge pull request #29 from cs574296/master
randybeard Dec 10, 2020
d650286
Merge pull request #28 from cjohns94/master
randybeard Dec 10, 2020
f906336
Merge pull request #27 from dispencer17/master
randybeard Dec 10, 2020
2313f11
Add an application example: spline basis construction
cgoates Dec 11, 2020
cfcab6d
added new file about prerequisites not covered in engineering courses.
Dec 11, 2020
fbbf153
Merge pull request #31 from MAK4DAVSYS/master
randybeard Dec 11, 2020
dd9ca20
Merge pull request #30 from cgoates/master
randybeard Dec 11, 2020
6e812e4
Merge pull request #26 from truchti/master
randybeard Dec 11, 2020
ba6ff9c
Merge pull request #22 from dan-free/master
randybeard Dec 11, 2020
8cc7adf
Merge pull request #18 from jhunt92/master
randybeard Dec 11, 2020
9bae2c1
Added a '2' to the end of the filename as per Dr Beard
dan-free Dec 11, 2020
237da99
Jonathan Barrett's Jupyter Notebook Project
jab128 Dec 11, 2020
517c8aa
Merge pull request #33 from jab128/master
randybeard Dec 11, 2020
9a82c57
Revert t17_lu_factorization back to Spencer's version
dan-free Dec 11, 2020
a58353a
Changed table of contents and added t28_lagrange_multipliers.ipynb
randybeard Dec 11, 2020
ff9356c
Merge pull request #20 from cjcarver/master
randybeard Dec 11, 2020
fa92931
added t15_matrix_inversion_lemma and t9_dual_approximation
randybeard Dec 11, 2020
84daca8
merging branch with new t5 adn t15
randybeard Dec 11, 2020
f2a39c2
Merge pull request #17 from jknight2786/master
randybeard Dec 11, 2020
b926c48
Merge pull request #16 from RainRunner1/master
randybeard Dec 11, 2020
160d105
Merge pull request #15 from re1983/master
randybeard Dec 11, 2020
6bfcf62
Merge pull request #14 from atwitchell/master
randybeard Dec 11, 2020
e9dd3a8
Merge pull request #13 from bjacobm/master
randybeard Dec 11, 2020
eb76c30
Merge pull request #12 from ae6nr/redd
randybeard Dec 11, 2020
a4f176a
Merge pull request #11 from spencerwarrenj/spencer_jensen_branch
randybeard Dec 11, 2020
03189d4
Merge pull request #34 from dan-free/free_branch2
randybeard Dec 11, 2020
fa1fcf8
modified table of contents
randybeard Dec 11, 2020
8198238
Merge branch 'master' of github.com:randybeard/ece671-jupyter
randybeard Dec 11, 2020
6aa69d2
fourier series update
SerShea Dec 11, 2020
150e598
Merge pull request #35 from SerShea/shea_branch
randybeard Dec 11, 2020
8010d40
Create README.md
randybeard Dec 11, 2020
e5ade99
added update to t19_qr_factorization.ipynb
randybeard Dec 16, 2020
b2ed369
Added Jacob Ward's Multisource Acousttical Holography application topic
randybeard Dec 18, 2020
9bb8930
Moved jupyter notebooks to the directory jupyter, and added lecture n…
randybeard Dec 30, 2020
54157a7
removed .ipynb_checkpoints added by a student in Fall 2020
randybeard Dec 30, 2020
d5eb5ee
Changes to README file
randybeard Dec 30, 2020
f687b10
Additional modifications to README file
randybeard Dec 30, 2020
c25ebf7
Additional modifications to README file
randybeard Dec 30, 2020
f8f498a
Additional modifications to README file
randybeard Dec 30, 2020
c5ff7c3
modified .gitignore to ignore pdf files
randybeard Dec 30, 2020
fa48063
Additional modifications to README file
randybeard Dec 30, 2020
72f1241
Update README.md
randybeard Jan 13, 2022
3b4079b
Update README.md
randybeard Jan 13, 2022
3a17bc7
deleted the virtual environment
randybeard Jan 14, 2022
79fad43
Create .gitignore
randybeard Aug 2, 2023
1a8f898
Added a dummy file to added Fall2023_student_projects
randybeard Aug 2, 2023
ec79c75
Broke moon notes into bit size chunks
randybeard Sep 1, 2023
7d45da2
Update _28_Jordan_form.pdf
randybeard Oct 27, 2023
ad17410
updated slides on RLS
randybeard Dec 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
137 changes: 137 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
lecture_notes/ecen671_chap4.pdf
lecture_notes/ecen671_chap6.pdf
lecture_notes/ecen671_chap7.pdf
lecture_notes/ecen671_chap18.pdf
lecture_notes/ecen671_chap14.pdf

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
.idea/
.DS_STORE

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Mathematics of Signals and Systems

The files in this repository are developed for ECEn 671 taught in the Electrical and Computer Engineering Department at Brigham Young University. The purpose of the repository is to aid graduate students in learning common vector space and linear algebra techniques used in signal processing and control. The repository consists of two directories: The first containing lecture notes, written in beamer, and the second containing jupyter ipython notebooks written and edited by former students in my class. These contain working code examples and homework problems.

The textbook for the class is [Moon & Stirling](https://www.amazon.com/Mathematical-Methods-Algorithms-Signal-Processing/dp/0201361868/ref=sr_1_3?dchild=1&keywords=Todd+Moon&qid=1609361508&sr=8-3)

## Lecture Notes
* ecen671_chap2.tex - metric, vector, normed, and inner product spaces, topology, orthogonality, linear operators, projections, Gram Schmidt Orthogonalization
* ecen671_chap3.tex - approximation theory, dual approximation, underdetermined problems, generalized Fourier series
* ecen671_chap4.tex - linear operators, matrix norms, adjoint operator, fundamental subspaces, matrix inverses, matrix condition number, Schur complement, recursive least squares.
* ecen671_chap5.tex - LU Factorization, Cholesky Factorization, QR Factorization
* ecen671_chap6.tex - Eigenvalues and eigenvectors, Jordan form, Cayley-Hamilton theorem, self adjoint matrices, invariant subspaces, quadratic forms, eigenfilters
* ecen671_chap7.tex - singular value decomposition, pseudo inverse rank reducing approximations
* ecen671_chap14.tex - gradient descent, LMS adaptive filtering, Gauss-Newton, Levenberg-Marquardt
* ecen671_chap18.tex - constrained optimization, Lagrange multipliers, Kuhn-Tucker conditions

## Student Designed Jupiter Notebooks
The following links have been developed by BYU graduate students enrolled in ECEn 671 **Mathematics of Signals and Systems** during Fall Semester 2018, and revised during Fall 2020.

[**Topic 1. Vector Spaces**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t1_vector_spaces.ipynb)

[**Topic 2. Vector norms: 1-norm, 2-norm, p-norm, infinity-norm**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t2_vector_norms.ipynb)

[**Topic 3. Inner product and inner product spaces**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t3_inner_products.ipynb)

[**Topic 4. Linear independence**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t4_linear_independence.ipynb)

[**Topic 5. Orthonormal bases for vector spaces**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t5_orthonormal_bases.ipynb)

[**Topic 6. Projection operators**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t6_projection_operators.ipynb)

[**Topic 7. Gram-Schmidt orthogonalization**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t7_gram_schmidt.ipynb)

[**Topic 8. Linear regression (least squares)**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t8_linear_regression.ipynb)

[**Topic 9. Dual approximation (min-norm solutions)**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t9_dual_approximation.ipynb)

[**Topic 10. Generalized Fourier series**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t10_generalized_fourier_series.ipynb)

[**Topic 11. Matrix norms**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t11_matrix_norms.ipynb)

[**Topic 12. Linear operators**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t12_linear_operators.ipynb)

[**Topic 13. Adjoint operators**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t13_adjoint_operators.ipynb)

[**Topic 14. Matrix Inverses and pseudo-inverses**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t14_matrix_inverse.ipynb)

[**Topic 15. The matrix inversion lemma**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t15_matrix_inversion_lemma.ipynb)

[**Topic 16. Recursive least squares**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t16_recursive_least_squares.ipynb)

[**Topic 17. LU Factorization**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t17_lu_factorization.ipynb)

[**Topic 17. LU Factorization-2**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t17_lu_factorization2.ipynb)

[**Topic 18. Cholesky Factorization**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t18_cholesky_factorization.ipynb)

[**Topic 19. QR Factorization**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t19_qr_factorization.ipynb)

[**Topic 20. Eigenvalues and eigenvectors**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t20_eigenvalues.ipynb)

[**Topic 21. The matrix exponential**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t21_matrix_exponential.ipynb)

[**Topic 22. Differential equations and invariant subspaces**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t22_invariant_subspaces.ipynb)

[**Topic 23. Quadratic Forms**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t23_quadratic_forms.ipynb)

[**Topic 24. Singular Value Decomposition**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t24_singular_value_decomposition.ipynb)

[**Topic 25. The four fundamental spaces of a matrix**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t25_matrix_subspaces.ipynb)

[**Topic 26. Rank reducing approximations of a matrix**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t26_rank_reduction.ipynb)

[**Topic 27. Gradient Descent**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t27_gradient_descent.ipynb)

[**Topic 28. Lagrange Multipliers**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t28_lagrange_multipliers.ipynb)

[**Topic 29. Kuhn-Tucker Conditions**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/t29_kuhn_tucker.ipynb)

[**Appendix. Mathematical Preliminaries**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/appendix_math_preliminaries.ipynb)

## Applications

[**Splines Basis Construction**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/SplineBasisConstruction.ipynb)

[**Spline Basis Construction - Julia**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/SplineBasisConstruction.jl)

[**Dynamic Mode Decomposition**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/DynamicModeDecomposition.ipybn)

[**Multisource Statistically-Optimized Nearfield Acoustical Holography**](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/Application_M-SONAH.ipynb)


## How to Install Jupyter Notebooks

For the viewer only option: [http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/table_of_contents.ipynb](http://nbviewer.jupyter.org/github/randybeard/ece671_Math_of_Signals_Systems/blob/master/jupyter/table_of_contents.ipynb)

In a Linux/MacOS terminal, first set up pip:
```
sudo apt install python3-pip
```
Then install jupyter notebooks:
```
pip install notebook
```
Change directory to the local git repository and run notebook:
```
jupyter notebook
```
Use similar instructions for Windows.


[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/randybeard/ece671-jupyter/HEAD?filepath=table_of_contents.ipby)
Binary file added jupyter/3d_coordinate_axis.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jupyter/4SiteInternet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
166 changes: 166 additions & 0 deletions jupyter/Application_M-SONAH.ipynb

Large diffs are not rendered by default.

461 changes: 461 additions & 0 deletions jupyter/DynamicModeDecomposition.ipynb

Large diffs are not rendered by default.

Binary file added jupyter/Example_data.mat
Binary file not shown.
Binary file added jupyter/MSONAH_EXAMPLE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jupyter/MSONAH_EXAMPLE_CODE.zip
Binary file not shown.
Binary file added jupyter/MSONAH_EXAMPLE_CODE_GEOMETRY.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,099 changes: 2,099 additions & 0 deletions jupyter/SplineBasisConstruction.ipynb

Large diffs are not rendered by default.

110 changes: 110 additions & 0 deletions jupyter/SplineBasisConstruction.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import Plots
import LinearAlgebra

# p : Polynomial degree
# i : Basis function index. Valid input is 0 to p.
function bernstein( p::Integer, i::Integer )
if i > p || i < 0
return xi -> 0
end
return xi -> binomial( p, i ) * ( 1 - xi ) ^ ( p - i ) * xi ^ i
end

# p : Polynomial degree
# i : Basis function index. Valid input is 0 to p.
# n : Derivative order
function dBdxi( p::Integer, i::Integer, n::Integer )
if n == 0
return bernstein( p, i )
end

if p < 0
return xi -> 0
end

return xi -> p*( dBdxi( p - 1, i - 1, n - 1 )( xi ) - dBdxi( p - 1, i, n - 1 )( xi ) )
end

################## Mesh Functionality ###################

struct Mesh
degrees
smoothnesses
end

struct LocalFunc
elem
idx
end

function numLocalFunctions( mesh::Mesh )
return sum( [ p + 1 for p in mesh.degrees ] )
end

function numContinuityConstraints( mesh::Mesh )
return sum( [ k + 1 for k in mesh.smoothnesses ] )
end

function buildUniformMesh( n_elems::Integer, degree::Integer, smoothness::Integer )
degrees = [ degree for i in 1:n_elems ]
smoothnesses = [ smoothness for i in 2:n_elems ]
return Mesh( degrees, smoothnesses )
end

# Local Bernstein indexing to global Bernstein indexing
function localToGlobal( mesh::Mesh, localfunc::LocalFunc )
return ( localfunc.elem > 1 ? sum( [ mesh.degrees[ e ] + 1 for e in 1:localfunc.elem-1 ] ) : 0 ) + localfunc.idx + 1
end

function meshLocalFuncs( mesh::Mesh )
return [ ( [ [ LocalFunc( elem, i ) for i in 0:mesh.degrees[ elem ] ] for elem in 1:length( mesh.degrees ) ]... )... ]
end


##################### Plotting functionality #############

function plotLocalBases!( plt, mesh::Mesh )
for elem = 1:length( mesh.degrees )
p = mesh.degrees[ elem ]
Plots.plot!( plt, [ xi -> bernstein( p, i )( xi - elem + 1 ) for i in 0:p ], elem-1:0.01:(elem) )
end
plt
end

function plotSplineBasis!( plt, mesh::Mesh, coeffs )
function splineFunction( mesh::Mesh, coeffs )
return function ( elem, xi )
p = mesh.degrees[ elem ]
elem_coeffs = coeffs[ localToGlobal( mesh, LocalFunc( elem, 0 ) ):localToGlobal( mesh, LocalFunc( elem, p ) ) ];
return sum( [ elem_coeffs[i+1]*bernstein( p, i )( xi ) for i in 0:p ] )
end
end

for elem = 1:length( mesh.degrees )
Plots.plot!(
plt,
[ xi -> splineFunction( mesh, coeffs[:,i] )( elem, xi - elem + 1 ) for i in 1:size( coeffs, 2 ) ],
elem-1:0.01:elem )
end
end


function buildS( mesh::Mesh )
S = zeros( numContinuityConstraints( mesh ), numLocalFunctions( mesh ) );
constraint_index = 1;
for i in 1:length( mesh.smoothnesses )
for k in 0:mesh.smoothnesses[i]
for lf_ii in 0:mesh.degrees[i]
S[ constraint_index, localToGlobal( mesh, LocalFunc( i, lf_ii ) ) ] =
dBdxi( mesh.degrees[i], lf_ii, k )( 1.0 )
end

for lf_ii in 0:mesh.degrees[i+1]
S[ constraint_index, localToGlobal( mesh, LocalFunc( i+1, lf_ii ) ) ] =
-dBdxi( mesh.degrees[i+1], lf_ii, k )( 0.0 )
end
constraint_index += 1
end
end
return S
end;
Loading