open-space-toolkit-mathematics 4.5.3__py312-none-manylinux2014_x86_64.whl → 4.5.4__py312-none-manylinux2014_x86_64.whl
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.
Potentially problematic release.
This version of open-space-toolkit-mathematics might be problematic. Click here for more details.
- {open_space_toolkit_mathematics-4.5.3.dist-info → open_space_toolkit_mathematics-4.5.4.dist-info}/METADATA +1 -1
- {open_space_toolkit_mathematics-4.5.3.dist-info → open_space_toolkit_mathematics-4.5.4.dist-info}/RECORD +17 -17
- ostk/mathematics/OpenSpaceToolkitMathematicsPy.cpython-312-x86_64-linux-gnu.so +0 -0
- ostk/mathematics/curve_fitting/__init__.pyi +97 -7
- ostk/mathematics/curve_fitting/interpolator.pyi +204 -16
- ostk/mathematics/geometry/__init__.pyi +364 -32
- ostk/mathematics/geometry/d2/__init__.pyi +560 -48
- ostk/mathematics/geometry/d2/object.pyi +1524 -126
- ostk/mathematics/geometry/d3/__init__.pyi +772 -80
- ostk/mathematics/geometry/d3/object.pyi +3164 -250
- ostk/mathematics/geometry/d3/transformation/rotation.pyi +1007 -91
- ostk/mathematics/libopen-space-toolkit-mathematics.so.4 +0 -0
- ostk/mathematics/object.pyi +292 -22
- ostk/mathematics/solver.pyi +220 -16
- {open_space_toolkit_mathematics-4.5.3.dist-info → open_space_toolkit_mathematics-4.5.4.dist-info}/WHEEL +0 -0
- {open_space_toolkit_mathematics-4.5.3.dist-info → open_space_toolkit_mathematics-4.5.4.dist-info}/top_level.txt +0 -0
- {open_space_toolkit_mathematics-4.5.3.dist-info → open_space_toolkit_mathematics-4.5.4.dist-info}/zip-safe +0 -0
|
Binary file
|
ostk/mathematics/object.pyi
CHANGED
|
@@ -52,41 +52,199 @@ class RealInterval:
|
|
|
52
52
|
__hash__: typing.ClassVar[None] = None
|
|
53
53
|
@staticmethod
|
|
54
54
|
def clip(intervals: list[RealInterval], clipping_interval: RealInterval) -> list[RealInterval]:
|
|
55
|
-
|
|
55
|
+
"""
|
|
56
|
+
Clip a list of intervals with a clipping interval.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
intervals (list): List of intervals to clip.
|
|
60
|
+
clipping_interval (RealInterval): The interval to clip with.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
list: List of clipped intervals.
|
|
64
|
+
|
|
65
|
+
Example:
|
|
66
|
+
>>> intervals = [RealInterval.closed(0.0, 2.0), RealInterval.closed(3.0, 5.0)]
|
|
67
|
+
>>> clipping = RealInterval.closed(1.0, 4.0)
|
|
68
|
+
>>> clipped = RealInterval.clip(intervals, clipping)
|
|
69
|
+
"""
|
|
56
70
|
@staticmethod
|
|
57
71
|
def closed(lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> RealInterval:
|
|
58
|
-
|
|
72
|
+
"""
|
|
73
|
+
Create a closed interval [a, b].
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
lower_bound (float): The lower bound (inclusive).
|
|
77
|
+
upper_bound (float): The upper bound (inclusive).
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
RealInterval: A closed interval.
|
|
81
|
+
|
|
82
|
+
Example:
|
|
83
|
+
>>> interval = RealInterval.closed(0.0, 1.0) # [0, 1]
|
|
84
|
+
>>> interval.contains(0.0) # True
|
|
85
|
+
>>> interval.contains(1.0) # True
|
|
86
|
+
"""
|
|
59
87
|
@staticmethod
|
|
60
88
|
def get_gaps(intervals: list[RealInterval], bound: RealInterval = ...) -> list[RealInterval]:
|
|
61
|
-
|
|
89
|
+
"""
|
|
90
|
+
Find gaps between intervals in a list.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
intervals (list): List of intervals to find gaps between.
|
|
94
|
+
bound (RealInterval, optional): Bounding interval to consider gaps within. Defaults to undefined.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
list: List of intervals representing gaps.
|
|
98
|
+
|
|
99
|
+
Example:
|
|
100
|
+
>>> intervals = [RealInterval.closed(0.0, 1.0), RealInterval.closed(2.0, 3.0)]
|
|
101
|
+
>>> gaps = RealInterval.get_gaps(intervals) # Gap from 1.0 to 2.0
|
|
102
|
+
"""
|
|
62
103
|
@staticmethod
|
|
63
104
|
def half_open_left(lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> RealInterval:
|
|
64
|
-
|
|
105
|
+
"""
|
|
106
|
+
Create a half-open interval (a, b].
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
lower_bound (float): The lower bound (exclusive).
|
|
110
|
+
upper_bound (float): The upper bound (inclusive).
|
|
111
|
+
|
|
112
|
+
Returns:
|
|
113
|
+
RealInterval: A half-open left interval.
|
|
114
|
+
|
|
115
|
+
Example:
|
|
116
|
+
>>> interval = RealInterval.half_open_left(0.0, 1.0) # (0, 1]
|
|
117
|
+
>>> interval.contains(0.0) # False
|
|
118
|
+
>>> interval.contains(1.0) # True
|
|
119
|
+
"""
|
|
65
120
|
@staticmethod
|
|
66
121
|
def half_open_right(lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> RealInterval:
|
|
67
|
-
|
|
122
|
+
"""
|
|
123
|
+
Create a half-open interval [a, b).
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
lower_bound (float): The lower bound (inclusive).
|
|
127
|
+
upper_bound (float): The upper bound (exclusive).
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
RealInterval: A half-open right interval.
|
|
131
|
+
|
|
132
|
+
Example:
|
|
133
|
+
>>> interval = RealInterval.half_open_right(0.0, 1.0) # [0, 1)
|
|
134
|
+
>>> interval.contains(0.0) # True
|
|
135
|
+
>>> interval.contains(1.0) # False
|
|
136
|
+
"""
|
|
68
137
|
@staticmethod
|
|
69
138
|
def logical_and(intervals_1: list[RealInterval], intervals_2: list[RealInterval]) -> list[RealInterval]:
|
|
70
|
-
|
|
139
|
+
"""
|
|
140
|
+
Perform logical AND operation on two lists of intervals.
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
intervals_1 (list): First list of intervals.
|
|
144
|
+
intervals_2 (list): Second list of intervals.
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
list: List of intervals representing the intersection of both lists.
|
|
148
|
+
|
|
149
|
+
Example:
|
|
150
|
+
>>> intervals1 = [RealInterval.closed(0.0, 2.0)]
|
|
151
|
+
>>> intervals2 = [RealInterval.closed(1.0, 3.0)]
|
|
152
|
+
>>> result = RealInterval.logical_and(intervals1, intervals2) # [1.0, 2.0]
|
|
153
|
+
"""
|
|
71
154
|
@staticmethod
|
|
72
155
|
def logical_or(intervals_1: list[RealInterval], intervals_2: list[RealInterval]) -> list[RealInterval]:
|
|
73
|
-
|
|
156
|
+
"""
|
|
157
|
+
Perform logical OR operation on two lists of intervals.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
intervals_1 (list): First list of intervals.
|
|
161
|
+
intervals_2 (list): Second list of intervals.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
list: List of intervals representing the union of both lists.
|
|
165
|
+
|
|
166
|
+
Example:
|
|
167
|
+
>>> intervals1 = [RealInterval.closed(0.0, 1.0)]
|
|
168
|
+
>>> intervals2 = [RealInterval.closed(2.0, 3.0)]
|
|
169
|
+
>>> result = RealInterval.logical_or(intervals1, intervals2)
|
|
170
|
+
"""
|
|
74
171
|
@staticmethod
|
|
75
172
|
def merge(intervals: list[RealInterval]) -> list[RealInterval]:
|
|
76
|
-
|
|
173
|
+
"""
|
|
174
|
+
Merge overlapping intervals in a list.
|
|
175
|
+
|
|
176
|
+
Args:
|
|
177
|
+
intervals (list): List of intervals to merge.
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
list: List of merged intervals with no overlaps.
|
|
181
|
+
|
|
182
|
+
Example:
|
|
183
|
+
>>> intervals = [RealInterval.closed(0.0, 2.0), RealInterval.closed(1.0, 3.0)]
|
|
184
|
+
>>> merged = RealInterval.merge(intervals) # [RealInterval.closed(0.0, 3.0)]
|
|
185
|
+
"""
|
|
77
186
|
@staticmethod
|
|
78
187
|
def open(lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> RealInterval:
|
|
79
|
-
|
|
188
|
+
"""
|
|
189
|
+
Create an open interval (a, b).
|
|
190
|
+
|
|
191
|
+
Args:
|
|
192
|
+
lower_bound (float): The lower bound (exclusive).
|
|
193
|
+
upper_bound (float): The upper bound (exclusive).
|
|
194
|
+
|
|
195
|
+
Returns:
|
|
196
|
+
RealInterval: An open interval.
|
|
197
|
+
|
|
198
|
+
Example:
|
|
199
|
+
>>> interval = RealInterval.open(0.0, 1.0) # (0, 1)
|
|
200
|
+
>>> interval.contains(0.0) # False
|
|
201
|
+
>>> interval.contains(1.0) # False
|
|
202
|
+
>>> interval.contains(0.5) # True
|
|
203
|
+
"""
|
|
80
204
|
@staticmethod
|
|
81
205
|
def sort(intervals: list[RealInterval], by_lower_bound: bool = True, ascending: bool = True) -> list[RealInterval]:
|
|
82
|
-
|
|
206
|
+
"""
|
|
207
|
+
Sort a list of intervals.
|
|
208
|
+
|
|
209
|
+
Args:
|
|
210
|
+
intervals (list): List of intervals to sort.
|
|
211
|
+
by_lower_bound (bool, optional): Sort by lower bound if True, upper bound if False. Defaults to True.
|
|
212
|
+
ascending (bool, optional): Sort in ascending order if True, descending if False. Defaults to True.
|
|
213
|
+
|
|
214
|
+
Returns:
|
|
215
|
+
list: Sorted list of intervals.
|
|
216
|
+
|
|
217
|
+
Example:
|
|
218
|
+
>>> intervals = [RealInterval.closed(2.0, 3.0), RealInterval.closed(0.0, 1.0)]
|
|
219
|
+
>>> sorted_intervals = RealInterval.sort(intervals)
|
|
220
|
+
"""
|
|
83
221
|
@staticmethod
|
|
84
222
|
def undefined() -> RealInterval:
|
|
85
|
-
|
|
223
|
+
"""
|
|
224
|
+
Create an undefined interval.
|
|
225
|
+
|
|
226
|
+
Returns:
|
|
227
|
+
RealInterval: An undefined interval.
|
|
228
|
+
|
|
229
|
+
Example:
|
|
230
|
+
>>> undefined_interval = RealInterval.undefined()
|
|
231
|
+
>>> undefined_interval.is_defined() # False
|
|
232
|
+
"""
|
|
86
233
|
def __eq__(self, arg0: RealInterval) -> bool:
|
|
87
234
|
...
|
|
88
235
|
def __init__(self, lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real, type: typing.Any) -> None:
|
|
89
|
-
|
|
236
|
+
"""
|
|
237
|
+
Create an interval with specified bounds and type.
|
|
238
|
+
|
|
239
|
+
Args:
|
|
240
|
+
lower_bound (float): The lower bound of the interval.
|
|
241
|
+
upper_bound (float): The upper bound of the interval.
|
|
242
|
+
type (RealInterval.Type): The type of interval (Closed, Open, HalfOpenLeft, HalfOpenRight).
|
|
243
|
+
|
|
244
|
+
Example:
|
|
245
|
+
>>> interval = RealInterval(0.0, 1.0, RealInterval.Type.Closed) # [0, 1]
|
|
246
|
+
>>> interval = RealInterval(0.0, 1.0, RealInterval.Type.Open) # (0, 1)
|
|
247
|
+
"""
|
|
90
248
|
def __ne__(self, arg0: RealInterval) -> bool:
|
|
91
249
|
...
|
|
92
250
|
def __repr__(self) -> str:
|
|
@@ -95,23 +253,135 @@ class RealInterval:
|
|
|
95
253
|
...
|
|
96
254
|
@typing.overload
|
|
97
255
|
def contains(self, real: ostk.core.type.Real) -> bool:
|
|
98
|
-
|
|
256
|
+
"""
|
|
257
|
+
Check if the interval contains a real number.
|
|
258
|
+
|
|
259
|
+
Args:
|
|
260
|
+
real (float): The real number to check.
|
|
261
|
+
|
|
262
|
+
Returns:
|
|
263
|
+
bool: True if the interval contains the number, False otherwise.
|
|
264
|
+
|
|
265
|
+
Example:
|
|
266
|
+
>>> interval = RealInterval.closed(0.0, 1.0)
|
|
267
|
+
>>> interval.contains(0.5) # True
|
|
268
|
+
>>> interval.contains(1.5) # False
|
|
269
|
+
"""
|
|
99
270
|
@typing.overload
|
|
100
271
|
def contains(self, interval: RealInterval) -> bool:
|
|
101
|
-
|
|
272
|
+
"""
|
|
273
|
+
Check if this interval contains another interval.
|
|
274
|
+
|
|
275
|
+
Args:
|
|
276
|
+
interval (RealInterval): The interval to check containment for.
|
|
277
|
+
|
|
278
|
+
Returns:
|
|
279
|
+
bool: True if this interval contains the other interval, False otherwise.
|
|
280
|
+
|
|
281
|
+
Example:
|
|
282
|
+
>>> interval1 = RealInterval.closed(0.0, 2.0)
|
|
283
|
+
>>> interval2 = RealInterval.closed(0.5, 1.5)
|
|
284
|
+
>>> interval1.contains(interval2) # True
|
|
285
|
+
"""
|
|
102
286
|
def get_intersection_with(self, interval: RealInterval) -> RealInterval:
|
|
103
|
-
|
|
287
|
+
"""
|
|
288
|
+
Get the intersection of this interval with another interval.
|
|
289
|
+
|
|
290
|
+
Args:
|
|
291
|
+
interval (RealInterval): The interval to intersect with.
|
|
292
|
+
|
|
293
|
+
Returns:
|
|
294
|
+
RealInterval: The intersection interval, or undefined if no intersection.
|
|
295
|
+
|
|
296
|
+
Example:
|
|
297
|
+
>>> interval1 = RealInterval.closed(0.0, 2.0)
|
|
298
|
+
>>> interval2 = RealInterval.closed(1.0, 3.0)
|
|
299
|
+
>>> intersection = interval1.get_intersection_with(interval2)
|
|
300
|
+
>>> # intersection represents [1.0, 2.0]
|
|
301
|
+
"""
|
|
104
302
|
def get_lower_bound(self) -> ostk.core.type.Real:
|
|
105
|
-
|
|
303
|
+
"""
|
|
304
|
+
Get the lower bound of the interval.
|
|
305
|
+
|
|
306
|
+
Returns:
|
|
307
|
+
float: The lower bound value.
|
|
308
|
+
|
|
309
|
+
Example:
|
|
310
|
+
>>> interval = RealInterval.closed(0.0, 1.0)
|
|
311
|
+
>>> interval.get_lower_bound() # 0.0
|
|
312
|
+
"""
|
|
106
313
|
def get_union_with(self, interval: RealInterval) -> RealInterval:
|
|
107
|
-
|
|
314
|
+
"""
|
|
315
|
+
Get the union of this interval with another interval.
|
|
316
|
+
|
|
317
|
+
Args:
|
|
318
|
+
interval (RealInterval): The interval to union with.
|
|
319
|
+
|
|
320
|
+
Returns:
|
|
321
|
+
RealInterval: The union interval.
|
|
322
|
+
|
|
323
|
+
Example:
|
|
324
|
+
>>> interval1 = RealInterval.closed(0.0, 1.0)
|
|
325
|
+
>>> interval2 = RealInterval.closed(0.5, 2.0)
|
|
326
|
+
>>> union = interval1.get_union_with(interval2)
|
|
327
|
+
>>> # union represents [0.0, 2.0]
|
|
328
|
+
"""
|
|
108
329
|
def get_upper_bound(self) -> ostk.core.type.Real:
|
|
109
|
-
|
|
330
|
+
"""
|
|
331
|
+
Get the upper bound of the interval.
|
|
332
|
+
|
|
333
|
+
Returns:
|
|
334
|
+
float: The upper bound value.
|
|
335
|
+
|
|
336
|
+
Example:
|
|
337
|
+
>>> interval = RealInterval.closed(0.0, 1.0)
|
|
338
|
+
>>> interval.get_upper_bound() # 1.0
|
|
339
|
+
"""
|
|
110
340
|
def intersects(self, interval: RealInterval) -> bool:
|
|
111
|
-
|
|
341
|
+
"""
|
|
342
|
+
Check if this interval intersects with another interval.
|
|
343
|
+
|
|
344
|
+
Args:
|
|
345
|
+
interval (RealInterval): The interval to check intersection with.
|
|
346
|
+
|
|
347
|
+
Returns:
|
|
348
|
+
bool: True if intervals intersect, False otherwise.
|
|
349
|
+
|
|
350
|
+
Example:
|
|
351
|
+
>>> interval1 = RealInterval.closed(0.0, 2.0)
|
|
352
|
+
>>> interval2 = RealInterval.closed(1.0, 3.0)
|
|
353
|
+
>>> interval1.intersects(interval2) # True
|
|
354
|
+
"""
|
|
112
355
|
def is_defined(self) -> bool:
|
|
113
|
-
|
|
356
|
+
"""
|
|
357
|
+
Check if the interval is defined.
|
|
358
|
+
|
|
359
|
+
Returns:
|
|
360
|
+
bool: True if the interval is defined, False otherwise.
|
|
361
|
+
|
|
362
|
+
Example:
|
|
363
|
+
>>> interval = RealInterval.closed(0.0, 1.0)
|
|
364
|
+
>>> interval.is_defined() # True
|
|
365
|
+
"""
|
|
114
366
|
def is_degenerate(self) -> bool:
|
|
115
|
-
|
|
367
|
+
"""
|
|
368
|
+
Check if the interval is degenerate (single point).
|
|
369
|
+
|
|
370
|
+
Returns:
|
|
371
|
+
bool: True if the interval represents a single point, False otherwise.
|
|
372
|
+
|
|
373
|
+
Example:
|
|
374
|
+
>>> interval = RealInterval.closed(1.0, 1.0)
|
|
375
|
+
>>> interval.is_degenerate() # True
|
|
376
|
+
"""
|
|
116
377
|
def to_string(self) -> ostk.core.type.String:
|
|
117
|
-
|
|
378
|
+
"""
|
|
379
|
+
Convert the interval to a string representation.
|
|
380
|
+
|
|
381
|
+
Returns:
|
|
382
|
+
str: String representation of the interval.
|
|
383
|
+
|
|
384
|
+
Example:
|
|
385
|
+
>>> interval = RealInterval.closed(0.0, 1.0)
|
|
386
|
+
>>> interval.to_string() # "[0, 1]"
|
|
387
|
+
"""
|
ostk/mathematics/solver.pyi
CHANGED
|
@@ -90,20 +90,76 @@ class NumericalSolver:
|
|
|
90
90
|
__hash__: typing.ClassVar[None] = None
|
|
91
91
|
@staticmethod
|
|
92
92
|
def default() -> NumericalSolver:
|
|
93
|
-
|
|
93
|
+
"""
|
|
94
|
+
Create a default numerical solver.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
NumericalSolver: A solver with default settings.
|
|
98
|
+
|
|
99
|
+
Example:
|
|
100
|
+
>>> solver = NumericalSolver.default()
|
|
101
|
+
>>> solver.is_defined() # True
|
|
102
|
+
"""
|
|
94
103
|
@staticmethod
|
|
95
104
|
def string_from_log_type(log_type: typing.Any) -> ostk.core.type.String:
|
|
96
|
-
|
|
105
|
+
"""
|
|
106
|
+
Get string representation of a log type.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
log_type (NumericalSolver.LogType): The log type.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
str: String representation of the log type.
|
|
113
|
+
|
|
114
|
+
Example:
|
|
115
|
+
>>> NumericalSolver.string_from_log_type(NumericalSolver.LogType.NoLog)
|
|
116
|
+
"""
|
|
97
117
|
@staticmethod
|
|
98
118
|
def string_from_stepper_type(stepper_type: typing.Any) -> ostk.core.type.String:
|
|
99
|
-
|
|
119
|
+
"""
|
|
120
|
+
Get string representation of a stepper type.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
stepper_type (NumericalSolver.StepperType): The stepper type.
|
|
124
|
+
|
|
125
|
+
Returns:
|
|
126
|
+
str: String representation of the stepper type.
|
|
127
|
+
|
|
128
|
+
Example:
|
|
129
|
+
>>> NumericalSolver.string_from_stepper_type(NumericalSolver.StepperType.RungeKutta4)
|
|
130
|
+
"""
|
|
100
131
|
@staticmethod
|
|
101
132
|
def undefined() -> NumericalSolver:
|
|
102
|
-
|
|
133
|
+
"""
|
|
134
|
+
Create an undefined numerical solver.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
NumericalSolver: An undefined solver.
|
|
138
|
+
|
|
139
|
+
Example:
|
|
140
|
+
>>> solver = NumericalSolver.undefined()
|
|
141
|
+
>>> solver.is_defined() # False
|
|
142
|
+
"""
|
|
103
143
|
def __eq__(self, arg0: NumericalSolver) -> bool:
|
|
104
144
|
...
|
|
105
145
|
def __init__(self, log_type: typing.Any, stepper_type: typing.Any, time_step: ostk.core.type.Real, relative_tolerance: ostk.core.type.Real, absolute_tolerance: ostk.core.type.Real) -> None:
|
|
106
|
-
|
|
146
|
+
"""
|
|
147
|
+
Create a numerical solver with specified parameters.
|
|
148
|
+
|
|
149
|
+
Args:
|
|
150
|
+
log_type (NumericalSolver.LogType): The logging type for the solver.
|
|
151
|
+
stepper_type (NumericalSolver.StepperType): The stepper algorithm to use.
|
|
152
|
+
time_step (float): The time step for integration.
|
|
153
|
+
relative_tolerance (float): The relative tolerance for adaptive steppers.
|
|
154
|
+
absolute_tolerance (float): The absolute tolerance for adaptive steppers.
|
|
155
|
+
|
|
156
|
+
Example:
|
|
157
|
+
>>> solver = NumericalSolver(
|
|
158
|
+
... NumericalSolver.LogType.NoLog,
|
|
159
|
+
... NumericalSolver.StepperType.RungeKutta4,
|
|
160
|
+
... 1.0, 1e-12, 1e-12
|
|
161
|
+
... )
|
|
162
|
+
"""
|
|
107
163
|
def __ne__(self, arg0: NumericalSolver) -> bool:
|
|
108
164
|
...
|
|
109
165
|
def __repr__(self) -> str:
|
|
@@ -111,28 +167,176 @@ class NumericalSolver:
|
|
|
111
167
|
def __str__(self) -> str:
|
|
112
168
|
...
|
|
113
169
|
def get_absolute_tolerance(self) -> ostk.core.type.Real:
|
|
114
|
-
|
|
170
|
+
"""
|
|
171
|
+
Get the absolute tolerance of the solver.
|
|
172
|
+
|
|
173
|
+
Returns:
|
|
174
|
+
float: The absolute tolerance value.
|
|
175
|
+
|
|
176
|
+
Example:
|
|
177
|
+
>>> solver = NumericalSolver.default()
|
|
178
|
+
>>> abs_tol = solver.get_absolute_tolerance()
|
|
179
|
+
"""
|
|
115
180
|
def get_log_type(self) -> ...:
|
|
116
|
-
|
|
181
|
+
"""
|
|
182
|
+
Get the log type of the solver.
|
|
183
|
+
|
|
184
|
+
Returns:
|
|
185
|
+
NumericalSolver.LogType: The log type.
|
|
186
|
+
|
|
187
|
+
Example:
|
|
188
|
+
>>> solver = NumericalSolver.default()
|
|
189
|
+
>>> log_type = solver.get_log_type()
|
|
190
|
+
"""
|
|
117
191
|
def get_observed_state_vectors(self) -> list[tuple[numpy.ndarray[numpy.float64[m, 1]], float]]:
|
|
118
|
-
|
|
192
|
+
"""
|
|
193
|
+
Get the observed state vectors from the last integration.
|
|
194
|
+
|
|
195
|
+
Returns:
|
|
196
|
+
list: List of observed state vectors during integration.
|
|
197
|
+
|
|
198
|
+
Example:
|
|
199
|
+
>>> solver = NumericalSolver.default()
|
|
200
|
+
>>> # After performing integration...
|
|
201
|
+
>>> states = solver.get_observed_state_vectors()
|
|
202
|
+
"""
|
|
119
203
|
def get_relative_tolerance(self) -> ostk.core.type.Real:
|
|
120
|
-
|
|
204
|
+
"""
|
|
205
|
+
Get the relative tolerance of the solver.
|
|
206
|
+
|
|
207
|
+
Returns:
|
|
208
|
+
float: The relative tolerance value.
|
|
209
|
+
|
|
210
|
+
Example:
|
|
211
|
+
>>> solver = NumericalSolver.default()
|
|
212
|
+
>>> rel_tol = solver.get_relative_tolerance()
|
|
213
|
+
"""
|
|
121
214
|
def get_stepper_type(self) -> ...:
|
|
122
|
-
|
|
215
|
+
"""
|
|
216
|
+
Get the stepper type of the solver.
|
|
217
|
+
|
|
218
|
+
Returns:
|
|
219
|
+
NumericalSolver.StepperType: The stepper type.
|
|
220
|
+
|
|
221
|
+
Example:
|
|
222
|
+
>>> solver = NumericalSolver.default()
|
|
223
|
+
>>> stepper_type = solver.get_stepper_type()
|
|
224
|
+
"""
|
|
123
225
|
def get_time_step(self) -> ostk.core.type.Real:
|
|
124
|
-
|
|
226
|
+
"""
|
|
227
|
+
Get the time step of the solver.
|
|
228
|
+
|
|
229
|
+
Returns:
|
|
230
|
+
float: The time step value.
|
|
231
|
+
|
|
232
|
+
Example:
|
|
233
|
+
>>> solver = NumericalSolver.default()
|
|
234
|
+
>>> time_step = solver.get_time_step()
|
|
235
|
+
"""
|
|
125
236
|
@typing.overload
|
|
126
237
|
def integrate_duration(self, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: ostk.core.type.Real, arg2: typing.Any) -> tuple[numpy.ndarray[numpy.float64[m, 1]], float]:
|
|
127
|
-
|
|
238
|
+
"""
|
|
239
|
+
Integrate a system of differential equations for a specified duration.
|
|
240
|
+
|
|
241
|
+
Args:
|
|
242
|
+
state_vector (StateVector): Initial state vector.
|
|
243
|
+
duration_in_seconds (float): Integration duration in seconds.
|
|
244
|
+
system_of_equations (callable): Function defining the system of ODEs.
|
|
245
|
+
Signature: f(x, dxdt, t) -> StateVector
|
|
246
|
+
|
|
247
|
+
Returns:
|
|
248
|
+
StateVector: Final state vector after integration.
|
|
249
|
+
|
|
250
|
+
Example:
|
|
251
|
+
>>> def equations(x, dxdt, t):
|
|
252
|
+
... dxdt[0] = x[1] # dx/dt = v
|
|
253
|
+
... dxdt[1] = -x[0] # dv/dt = -x (harmonic oscillator)
|
|
254
|
+
... return dxdt
|
|
255
|
+
>>> solver = NumericalSolver.default()
|
|
256
|
+
>>> initial_state = [1.0, 0.0] # x=1, v=0
|
|
257
|
+
>>> final_state = solver.integrate_duration(initial_state, 1.0, equations)
|
|
258
|
+
"""
|
|
128
259
|
@typing.overload
|
|
129
260
|
def integrate_duration(self, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: list[ostk.core.type.Real], arg2: typing.Any) -> list[tuple[numpy.ndarray[numpy.float64[m, 1]], float]]:
|
|
130
|
-
|
|
261
|
+
"""
|
|
262
|
+
Integrate a system of differential equations at multiple duration points.
|
|
263
|
+
|
|
264
|
+
Args:
|
|
265
|
+
state_vector (StateVector): Initial state vector.
|
|
266
|
+
duration_array (list): Array of duration values in seconds.
|
|
267
|
+
system_of_equations (callable): Function defining the system of ODEs.
|
|
268
|
+
Signature: f(x, dxdt, t) -> StateVector
|
|
269
|
+
|
|
270
|
+
Returns:
|
|
271
|
+
list: State vectors at each duration point.
|
|
272
|
+
|
|
273
|
+
Example:
|
|
274
|
+
>>> def equations(x, dxdt, t):
|
|
275
|
+
... dxdt[0] = x[1] # dx/dt = v
|
|
276
|
+
... dxdt[1] = -x[0] # dv/dt = -x (harmonic oscillator)
|
|
277
|
+
... return dxdt
|
|
278
|
+
>>> solver = NumericalSolver.default()
|
|
279
|
+
>>> initial_state = [1.0, 0.0]
|
|
280
|
+
>>> durations = [0.5, 1.0, 1.5]
|
|
281
|
+
>>> states = solver.integrate_duration(initial_state, durations, equations)
|
|
282
|
+
"""
|
|
131
283
|
@typing.overload
|
|
132
284
|
def integrate_time(self, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: ostk.core.type.Real, arg2: ostk.core.type.Real, arg3: typing.Any) -> tuple[numpy.ndarray[numpy.float64[m, 1]], float]:
|
|
133
|
-
|
|
285
|
+
"""
|
|
286
|
+
Integrate a system of differential equations from start to end time.
|
|
287
|
+
|
|
288
|
+
Args:
|
|
289
|
+
state_vector (StateVector): Initial state vector.
|
|
290
|
+
start_time (float): Integration start time.
|
|
291
|
+
end_time (float): Integration end time.
|
|
292
|
+
system_of_equations (callable): Function defining the system of ODEs.
|
|
293
|
+
Signature: f(x, dxdt, t) -> StateVector
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
StateVector: Final state vector at end time.
|
|
297
|
+
|
|
298
|
+
Example:
|
|
299
|
+
>>> def equations(x, dxdt, t):
|
|
300
|
+
... dxdt[0] = x[1] # dx/dt = v
|
|
301
|
+
... dxdt[1] = -x[0] # dv/dt = -x (harmonic oscillator)
|
|
302
|
+
... return dxdt
|
|
303
|
+
>>> solver = NumericalSolver.default()
|
|
304
|
+
>>> initial_state = [1.0, 0.0]
|
|
305
|
+
>>> final_state = solver.integrate_time(initial_state, 0.0, 2.0, equations)
|
|
306
|
+
"""
|
|
134
307
|
@typing.overload
|
|
135
308
|
def integrate_time(self, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: ostk.core.type.Real, arg2: list[ostk.core.type.Real], arg3: typing.Any) -> list[tuple[numpy.ndarray[numpy.float64[m, 1]], float]]:
|
|
136
|
-
|
|
309
|
+
"""
|
|
310
|
+
Integrate a system of differential equations at specified time points.
|
|
311
|
+
|
|
312
|
+
Args:
|
|
313
|
+
state_vector (StateVector): Initial state vector.
|
|
314
|
+
start_time (float): Integration start time.
|
|
315
|
+
time_array (list): Array of time points to evaluate at.
|
|
316
|
+
system_of_equations (callable): Function defining the system of ODEs.
|
|
317
|
+
Signature: f(x, dxdt, t) -> StateVector
|
|
318
|
+
|
|
319
|
+
Returns:
|
|
320
|
+
list: State vectors at each time point.
|
|
321
|
+
|
|
322
|
+
Example:
|
|
323
|
+
>>> def equations(x, dxdt, t):
|
|
324
|
+
... dxdt[0] = x[1] # dx/dt = v
|
|
325
|
+
... dxdt[1] = -x[0] # dv/dt = -x (harmonic oscillator)
|
|
326
|
+
... return dxdt
|
|
327
|
+
>>> solver = NumericalSolver.default()
|
|
328
|
+
>>> initial_state = [1.0, 0.0]
|
|
329
|
+
>>> times = [0.5, 1.0, 1.5, 2.0]
|
|
330
|
+
>>> states = solver.integrate_time(initial_state, 0.0, times, equations)
|
|
331
|
+
"""
|
|
137
332
|
def is_defined(self) -> bool:
|
|
138
|
-
|
|
333
|
+
"""
|
|
334
|
+
Check if the numerical solver is defined.
|
|
335
|
+
|
|
336
|
+
Returns:
|
|
337
|
+
bool: True if the solver is defined, False otherwise.
|
|
338
|
+
|
|
339
|
+
Example:
|
|
340
|
+
>>> solver = NumericalSolver.default()
|
|
341
|
+
>>> solver.is_defined() # True
|
|
342
|
+
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|