Skip to content

Commit 8864727

Browse files
committed
#F-239 In Progress
Inverse solution for three-layer model: ашч H1 and H2 variations
1 parent 7bae6da commit 8864727

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Util/src/main/java/com/ak/rsm/inverse/DynamicInverse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public double applyAsDouble(TetrapolarSystem s, double[] kw) {
4343
};
4444
}
4545

46-
private static double dH(Collection<? extends DerivativeResistivity> r) {
46+
static double dH(Collection<? extends DerivativeResistivity> r) {
4747
return r.stream().mapToDouble(DerivativeResistivity::dh)
4848
.reduce((left, right) -> Double.compare(left, right) == 0 ? left : Double.NaN).orElse(Double.NaN);
4949
}

Util/src/test/java/com/ak/rsm/inverse/Inverse3Test.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ private static void testSingle(Collection<? extends DerivativeMeasurement> dm) {
9393

9494
assertThatNoException().isThrownBy(() -> {
9595
int scale = 2;
96-
double hStep = dm.stream().flatMapToDouble(m -> DoubleStream.of(Math.abs(m.dh()))).min().orElseThrow() / scale;
96+
double dh1 = DynamicInverse.dH(dm);
97+
double hStep = Math.abs(dh1 / scale);
9798
LOGGER.info("3-layer step {}", ValuePair.Name.H.of(hStep, 0.0));
9899

99100
ValuePair.Name[] keys = {
@@ -110,7 +111,9 @@ private static void testSingle(Collection<? extends DerivativeMeasurement> dm) {
110111
double[] p = Stream.of(h1, dh2).mapToDouble(x -> x.value() / hStep).toArray();
111112

112113
PointValuePair optimizedK = Simplex.optimizeAll(
113-
k -> DynamicInverse.ofH1Changed(dm, hStep).applyAsDouble(DoubleStream.concat(Arrays.stream(k), Arrays.stream(p)).toArray()),
114+
k -> DynamicInverse.of(dm, hStep, DeltaH.H1.apply(dh1)).applyAsDouble(
115+
DoubleStream.concat(Arrays.stream(k), Arrays.stream(p)).toArray()
116+
),
114117
new Simplex.Bounds(0.0, 1.0), new Simplex.Bounds(-1.0, 0.0)
115118
);
116119

0 commit comments

Comments
 (0)