Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F112387851
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 10, 08:47
Size
402 B
Mime Type
text/x-python
Expires
Mon, May 12, 08:47 (1 d, 13 h)
Engine
blob
Format
Raw Data
Handle
26085089
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