executable-engineering 0.1.51__tar.gz → 0.1.53__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/PKG-INFO +1 -1
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/__init__.py +8 -10
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/numerical_integration_module.py +26 -34
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering.egg-info/PKG-INFO +1 -1
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/setup.py +1 -1
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/LICENSE +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/README.md +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/closedoptimization_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/closedrootfinder_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/constrainedoptimization_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/differentiation_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/display_code_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/functions_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/gradientoptimization_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/integration_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/linearsystems_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/neuralnet_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/numerical_error_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/openoptimization_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/openrootfinder_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/optimization_module.py +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering.egg-info/SOURCES.txt +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering.egg-info/dependency_links.txt +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering.egg-info/requires.txt +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering.egg-info/top_level.txt +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/pyproject.toml +0 -0
- {executable_engineering-0.1.51 → executable_engineering-0.1.53}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: executable_engineering
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.53
|
|
4
4
|
Summary: Demonstrative tools for the Executable Engineering textbook
|
|
5
5
|
Home-page: https://github.com/themintlab/ExecutableEngineering/tree/main/executable_engineering
|
|
6
6
|
Author: Michael Welland
|
{executable_engineering-0.1.51 → executable_engineering-0.1.53}/executable_engineering/__init__.py
RENAMED
|
@@ -72,7 +72,6 @@ from .differentiation_module import (
|
|
|
72
72
|
plot_uneven_spacing_derivative,
|
|
73
73
|
)
|
|
74
74
|
from .integration_module import (
|
|
75
|
-
trapezoid_rule,
|
|
76
75
|
simpson_13_rule,
|
|
77
76
|
simpson_38_rule,
|
|
78
77
|
romberg_integration,
|
|
@@ -89,10 +88,10 @@ from .integration_module import (
|
|
|
89
88
|
plot_gaussian_quadrature,
|
|
90
89
|
)
|
|
91
90
|
from .numerical_integration_module import (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
left_riemann,
|
|
92
|
+
visualize_left_riemann,
|
|
93
|
+
right_riemann,
|
|
94
|
+
visualize_right_riemann,
|
|
96
95
|
midpoint_riemann,
|
|
97
96
|
visualize_midpoint_riemann,
|
|
98
97
|
trapezoid_rule,
|
|
@@ -181,7 +180,6 @@ __all__ = [
|
|
|
181
180
|
"plot_frequency_noise_spectrum",
|
|
182
181
|
"plot_uneven_spacing_derivative",
|
|
183
182
|
# Integration module
|
|
184
|
-
"trapezoid_rule",
|
|
185
183
|
"simpson_13_rule",
|
|
186
184
|
"simpson_38_rule",
|
|
187
185
|
"romberg_integration",
|
|
@@ -196,10 +194,10 @@ __all__ = [
|
|
|
196
194
|
"plot_simpson_rule",
|
|
197
195
|
"plot_romberg_convergence",
|
|
198
196
|
"plot_gaussian_quadrature",
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"
|
|
202
|
-
"
|
|
197
|
+
"left_riemann",
|
|
198
|
+
"visualize_left_riemann",
|
|
199
|
+
"right_riemann",
|
|
200
|
+
"visualize_right_riemann",
|
|
203
201
|
"midpoint_riemann",
|
|
204
202
|
"visualize_midpoint_riemann",
|
|
205
203
|
"trapezoid_rule",
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import numpy as np
|
|
2
2
|
import plotly.graph_objects as go
|
|
3
3
|
|
|
4
|
-
def
|
|
5
|
-
|
|
4
|
+
def left_riemann(f, a, b, n):
|
|
5
|
+
h = (b - a) / n
|
|
6
|
+
x_left = np.linspace(a, b - h, n)
|
|
6
7
|
y_left = f(x_left)
|
|
7
8
|
integral_approx = np.sum(y_left * h)
|
|
8
9
|
|
|
9
10
|
return {
|
|
10
11
|
"x_left": x_left,
|
|
11
12
|
"y_left": y_left,
|
|
13
|
+
"n": n,
|
|
12
14
|
"integral_approx": integral_approx,
|
|
13
15
|
"a": a,
|
|
14
16
|
"b": b,
|
|
@@ -16,7 +18,7 @@ def left_reimann(f, a, b, h):
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
|
|
19
|
-
def
|
|
21
|
+
def visualize_left_riemann(f, data):
|
|
20
22
|
x_left = data["x_left"]
|
|
21
23
|
y_left = data["y_left"]
|
|
22
24
|
integral_approx = data["integral_approx"]
|
|
@@ -132,9 +134,9 @@ def visualize_left_reimann(f, data):
|
|
|
132
134
|
return fig
|
|
133
135
|
|
|
134
136
|
|
|
135
|
-
def
|
|
136
|
-
|
|
137
|
-
x_right =
|
|
137
|
+
def right_riemann(f, a, b, n):
|
|
138
|
+
h = (b - a) / n
|
|
139
|
+
x_right = np.linspace(a + h, b, n)
|
|
138
140
|
y_right = f(x_right)
|
|
139
141
|
|
|
140
142
|
integral_approx = np.sum(y_right * h)
|
|
@@ -142,6 +144,7 @@ def right_reimann(f, a, b, h):
|
|
|
142
144
|
return {
|
|
143
145
|
"x_right": x_right,
|
|
144
146
|
"y_right": y_right,
|
|
147
|
+
"n": n,
|
|
145
148
|
"integral_approx": integral_approx,
|
|
146
149
|
"a": a,
|
|
147
150
|
"b": b,
|
|
@@ -149,7 +152,7 @@ def right_reimann(f, a, b, h):
|
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
|
|
152
|
-
def
|
|
155
|
+
def visualize_right_riemann(f, data):
|
|
153
156
|
x_right = data["x_right"]
|
|
154
157
|
y_right = data["y_right"]
|
|
155
158
|
integral_approx = data["integral_approx"]
|
|
@@ -267,8 +270,9 @@ def visualize_right_reimann(f, data):
|
|
|
267
270
|
return fig
|
|
268
271
|
|
|
269
272
|
|
|
270
|
-
def midpoint_riemann(f, a, b,
|
|
271
|
-
|
|
273
|
+
def midpoint_riemann(f, a, b, n):
|
|
274
|
+
h = (b - a) / n
|
|
275
|
+
x_mid = np.linspace(a + h / 2, b - h / 2, n)
|
|
272
276
|
y_mid = f(x_mid)
|
|
273
277
|
|
|
274
278
|
integral_approx = np.sum(y_mid * h)
|
|
@@ -276,6 +280,7 @@ def midpoint_riemann(f, a, b, h):
|
|
|
276
280
|
return {
|
|
277
281
|
"x_mid": x_mid,
|
|
278
282
|
"y_mid": y_mid,
|
|
283
|
+
"n": n,
|
|
279
284
|
"integral_approx": integral_approx,
|
|
280
285
|
"a": a,
|
|
281
286
|
"b": b,
|
|
@@ -402,11 +407,9 @@ def visualize_midpoint_riemann(f, data):
|
|
|
402
407
|
return fig
|
|
403
408
|
|
|
404
409
|
|
|
405
|
-
def trapezoid_rule(f, a, b,
|
|
406
|
-
|
|
407
|
-
x_points = np.
|
|
408
|
-
x_points = np.unique(x_points)
|
|
409
|
-
|
|
410
|
+
def trapezoid_rule(f, a, b, n):
|
|
411
|
+
h = (b - a) / n
|
|
412
|
+
x_points = np.linspace(a, b, n + 1)
|
|
410
413
|
y_points = f(x_points)
|
|
411
414
|
|
|
412
415
|
widths = np.diff(x_points)
|
|
@@ -416,6 +419,7 @@ def trapezoid_rule(f, a, b, h):
|
|
|
416
419
|
"x_points": x_points,
|
|
417
420
|
"y_points": y_points,
|
|
418
421
|
"widths": widths,
|
|
422
|
+
"n": n,
|
|
419
423
|
"integral_approx": integral_approx,
|
|
420
424
|
"a": a,
|
|
421
425
|
"b": b,
|
|
@@ -543,16 +547,11 @@ def visualize_trapezoid_rule(f, data):
|
|
|
543
547
|
|
|
544
548
|
return fig
|
|
545
549
|
|
|
546
|
-
def simpsons_13(f, a, b,
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
if not np.isclose(n_float, n) or n <= 0:
|
|
551
|
-
raise ValueError("(b - a) must be a positive integer multiple of h.")
|
|
552
|
-
|
|
553
|
-
if n % 2 != 0:
|
|
554
|
-
raise ValueError("Simpson's 1/3 Rule requires an even number of subintervals.")
|
|
550
|
+
def simpsons_13(f, a, b, n):
|
|
551
|
+
if n <= 0 or n % 2 != 0:
|
|
552
|
+
raise ValueError("Simpson's 1/3 Rule requires a positive even number of subintervals.")
|
|
555
553
|
|
|
554
|
+
h = (b - a) / n
|
|
556
555
|
x_points = np.linspace(a, b, n + 1)
|
|
557
556
|
y_points = np.asarray(f(x_points))
|
|
558
557
|
|
|
@@ -563,7 +562,6 @@ def simpsons_13(f, a, b, h):
|
|
|
563
562
|
+ 2 * np.sum(y_points[2:-1:2])
|
|
564
563
|
)
|
|
565
564
|
|
|
566
|
-
|
|
567
565
|
return {
|
|
568
566
|
"x_points": x_points,
|
|
569
567
|
"y_points": y_points,
|
|
@@ -720,16 +718,11 @@ def visualize_simpsons_13(f, data):
|
|
|
720
718
|
|
|
721
719
|
return fig
|
|
722
720
|
|
|
723
|
-
def simpsons_38(f, a, b,
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
if not np.isclose(n_float, n) or n <= 0:
|
|
728
|
-
raise ValueError("(b - a) must be a positive integer multiple of h.")
|
|
729
|
-
|
|
730
|
-
if n % 3 != 0:
|
|
731
|
-
raise ValueError("Simpson's 3/8 Rule requires a number of subintervals divisible by 3.")
|
|
721
|
+
def simpsons_38(f, a, b, n):
|
|
722
|
+
if n <= 0 or n % 3 != 0:
|
|
723
|
+
raise ValueError("Simpson's 3/8 Rule requires a positive number of subintervals divisible by 3.")
|
|
732
724
|
|
|
725
|
+
h = (b - a) / n
|
|
733
726
|
x_points = np.linspace(a, b, n + 1)
|
|
734
727
|
y_points = np.asarray(f(x_points))
|
|
735
728
|
|
|
@@ -740,7 +733,6 @@ def simpsons_38(f, a, b, h):
|
|
|
740
733
|
|
|
741
734
|
integral_approx = (3 * h / 8) * np.sum(weights * y_points)
|
|
742
735
|
|
|
743
|
-
|
|
744
736
|
return {
|
|
745
737
|
"x_points": x_points,
|
|
746
738
|
"y_points": y_points,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: executable_engineering
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.53
|
|
4
4
|
Summary: Demonstrative tools for the Executable Engineering textbook
|
|
5
5
|
Home-page: https://github.com/themintlab/ExecutableEngineering/tree/main/executable_engineering
|
|
6
6
|
Author: Michael Welland
|
|
@@ -6,7 +6,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="executable_engineering",
|
|
9
|
-
version="0.1.
|
|
9
|
+
version="0.1.53",
|
|
10
10
|
description="Demonstrative tools for the Executable Engineering textbook",
|
|
11
11
|
long_description=long_description,
|
|
12
12
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|