Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61028856
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
Sat, May 4, 02:14
Size
402 B
Mime Type
text/x-python
Expires
Mon, May 6, 02:14 (2 d)
Engine
blob
Format
Raw Data
Handle
17372561
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