chore: sync project state and current artifacts
This commit is contained in:
@@ -113,19 +113,33 @@ All types support: `__repr__`, `__str__`, `__float__`, `__eq__`, `__add__`, `__s
|
||||
| `FlowSource` | `(pressure_pa, temperature_k)` | Boundary source |
|
||||
| `FlowSink` | `()` | Boundary sink |
|
||||
|
||||
### Solver
|
||||
### Solver Configurations
|
||||
|
||||
| Config | Constructor | Description |
|
||||
|-----------|------------|-------------|
|
||||
| `NewtonConfig` | `(max_iterations, tolerance, line_search, timeout_ms, initial_state, use_numerical_jacobian, jacobian_freezing, convergence_criteria, timeout_config, previous_state, ...)` | Newton-Raphson settings |
|
||||
| `PicardConfig` | `(max_iterations, tolerance, relaxation, initial_state, timeout_ms, convergence_criteria)` | Picard / Seq. Substitution settings |
|
||||
| `FallbackConfig` | `(newton, picard)` | Fallback behavior |
|
||||
| `ConvergenceCriteria`| `(pressure_tolerance_pa, mass_balance_tolerance_kgs, energy_balance_tolerance_w)`| Detailed component criteria |
|
||||
| `JacobianFreezingConfig`| `(max_frozen_iters, threshold)`| Speeds up Newton-Raphson |
|
||||
| `TimeoutConfig` | `(return_best_state_on_timeout, zoh_fallback)`| Behavior on timeout limit |
|
||||
|
||||
### Solver Running
|
||||
|
||||
```python
|
||||
# Newton-Raphson (fast convergence)
|
||||
config = entropyk.NewtonConfig(max_iterations=100, tolerance=1e-6, line_search=True)
|
||||
# Strategy Enum approach
|
||||
strategy = entropyk.SolverStrategy.newton(max_iterations=100, tolerance=1e-6)
|
||||
# Or
|
||||
strategy = entropyk.SolverStrategy.picard(relaxation=0.5)
|
||||
|
||||
# Picard / Sequential Substitution (more robust)
|
||||
config = entropyk.PicardConfig(max_iterations=500, tolerance=1e-4, relaxation=0.5)
|
||||
result = strategy.solve(system) # Returns ConvergedState
|
||||
|
||||
# Fallback (Newton → Picard on divergence)
|
||||
config = entropyk.FallbackConfig(newton=newton_cfg, picard=picard_cfg)
|
||||
|
||||
result = config.solve(system) # Returns ConvergedState
|
||||
# Legacy Config approach
|
||||
config = entropyk.FallbackConfig(
|
||||
newton=entropyk.NewtonConfig(max_iterations=100),
|
||||
picard=entropyk.PicardConfig(max_iterations=500)
|
||||
)
|
||||
result = config.solve(system)
|
||||
```
|
||||
|
||||
### Exceptions
|
||||
|
||||
Reference in New Issue
Block a user