Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F59963383
FiniteDifferenceLib.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Apr 26, 09:42
Size
402 B
Mime Type
text/x-python
Expires
Sun, Apr 28, 09:42 (2 d)
Engine
blob
Format
Raw Data
Handle
16863311
Attached To
rPUBNUMANALYSIS Public Numerical Analysis Jupyter Notebook
FiniteDifferenceLib.py
View Options
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 30
@author: Simone Deparis
"""
import
numpy
as
np
# This function just provides a line to compare the convergence in a log-log plot.
def
sampleConvergence
(
h
,
order
,
ref
)
:
# computes a pseudo order of convergence on h
# ref is a reference maximum value
return
h
**
order
*
(
ref
/
np
.
max
(
np
.
abs
(
h
))
**
order
)
Event Timeline
Log In to Comment