probably working combined code :D
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import numpy as np
|
||||
from Ausgleichsbecken_functions import FODE_function, get_h_halfstep, get_p_halfstep
|
||||
# from Ausgleichsbecken_functions import FODE_function, get_h_halfstep, get_p_halfstep
|
||||
|
||||
#importing pressure conversion function
|
||||
import sys
|
||||
@@ -9,6 +9,11 @@ parent = os.path.dirname(current)
|
||||
sys.path.append(parent)
|
||||
from functions.pressure_conversion import pressure_conversion
|
||||
|
||||
def FODE_function(x, h, alpha, p, rho=1000., g=9.81):
|
||||
f = x*abs(x)/h*alpha+g-p/(rho*h)
|
||||
return f
|
||||
|
||||
|
||||
class Ausgleichsbecken_class:
|
||||
# units
|
||||
# make sure that units and print units are the same
|
||||
|
||||
@@ -25,6 +25,6 @@ def e_RK_4(yn, h, dt, Q0, Q1, A0, A1, p0, p1):
|
||||
Y2 = yn + dt/2*FODE_function(Y1, h, alpha, p0)
|
||||
Y3 = yn + dt/2*FODE_function(Y2, h_hs, alpha, p_hs)
|
||||
Y4 = yn + dt*FODE_function(Y3, h_hs, alpha, p_hs)
|
||||
ynp1 = yn + dt/6*(FODE_function(Y1, h, alpha, p)+2*FODE_function(Y2, h_hs, alpha, p_hs)+ \
|
||||
2*FODE_function(Y3, h_hs, alpha, p_hs)+ FODE_function(Y4, h, alpha, p))
|
||||
ynp1 = yn + dt/6*(FODE_function(Y1, h, alpha, p0)+2*FODE_function(Y2, h_hs, alpha, p_hs)+ \
|
||||
2*FODE_function(Y3, h_hs, alpha, p_hs)+ FODE_function(Y4, h, alpha, p0))
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": 17,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": 18,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -133,7 +133,7 @@
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.8.13 ('DT_Slot_3')",
|
||||
"display_name": "Python 3.8.13 ('Georg_DT_Slot3')",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
@@ -152,7 +152,7 @@
|
||||
"orig_nbformat": 4,
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "4a28055eb8a3160fa4c7e4fca69770c4e0a1add985300856aa3fcf4ce32a2c48"
|
||||
"hash": "84fb123bdc47ab647d3782661abcbe80fbb79236dd2f8adf4cef30e8755eb2cd"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user