Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80500078
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
Sun, Sep 1, 01:57
Size
402 B
Mime Type
text/x-python
Expires
Tue, Sep 3, 01:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20314683
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