Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSCommon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSCommon
Commits
6bd9f5e1
Commit
6bd9f5e1
authored
3 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix in single sine wave function alpha * cos, not acos....
parent
a1340aa4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/no/nibio/vips/model/maths/NonLinearCurves.java
+2
-2
2 additions, 2 deletions
src/main/java/no/nibio/vips/model/maths/NonLinearCurves.java
src/test/java/no/nibio/vips/model/maths/NonLinearCurvesTest.java
+9
-0
9 additions, 0 deletions
...t/java/no/nibio/vips/model/maths/NonLinearCurvesTest.java
with
11 additions
and
2 deletions
src/main/java/no/nibio/vips/model/maths/NonLinearCurves.java
+
2
−
2
View file @
6bd9f5e1
...
@@ -87,7 +87,7 @@ public class NonLinearCurves {
...
@@ -87,7 +87,7 @@ public class NonLinearCurves {
* <p>Based on Baskerville et al (1969): Rapid estimation of heat accumulation
* <p>Based on Baskerville et al (1969): Rapid estimation of heat accumulation
* from maximum and minimum temperatures. Ref Figure 1</p>
* from maximum and minimum temperatures. Ref Figure 1</p>
* <p>Formulas from Zalom et al 1983: Degree-days: The calculation and use
* <p>Formulas from Zalom et al 1983: Degree-days: The calculation and use
* of heat units in pest managemen
g
. Division of Agriculture and Natural resources,
* of heat units in pest managemen
t
. Division of Agriculture and Natural resources,
* University of California. Leaflet 21373</p>
* University of California. Leaflet 21373</p>
* @param Tmin minimum value of sine wave
* @param Tmin minimum value of sine wave
* @param Tmax maximum value of sine wave
* @param Tmax maximum value of sine wave
...
@@ -137,7 +137,7 @@ public class NonLinearCurves {
...
@@ -137,7 +137,7 @@ public class NonLinearCurves {
return
(
1
/
Math
.
PI
)
*
(
return
(
1
/
Math
.
PI
)
*
(
(
m
-
Tl
)*(
theta_2
+
Math
.
PI
/
2
)
(
m
-
Tl
)*(
theta_2
+
Math
.
PI
/
2
)
+
(
Tu
-
Tl
)*(
Math
.
PI
/
2
-
theta_2
)
+
(
Tu
-
Tl
)*(
Math
.
PI
/
2
-
theta_2
)
-
Math
.
a
cos
(
theta_2
)
-
(
alpha
*
Math
.
cos
(
theta_2
)
)
);
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/test/java/no/nibio/vips/model/maths/NonLinearCurvesTest.java
+
9
−
0
View file @
6bd9f5e1
...
@@ -198,6 +198,15 @@ public class NonLinearCurvesTest extends TestCase {
...
@@ -198,6 +198,15 @@ public class NonLinearCurvesTest extends TestCase {
result
=
instance
.
calculateSingleSineWaveWithCutoff
(
tMin
,
tMax
,
thresholdLower
,
thresholdUpper
);
result
=
instance
.
calculateSingleSineWaveWithCutoff
(
tMin
,
tMax
,
thresholdLower
,
thresholdUpper
);
assertEquals
(
expectedResult
,
result
,
0.1
);
assertEquals
(
expectedResult
,
result
,
0.1
);
// tMax is above Tu, tMin is above Tl
tMax
=
31.8
;
tMin
=
16.6
;
thresholdUpper
=
31.1
;
thresholdLower
=
15.0
;
expectedResult
=
9.135946967874313
;
result
=
instance
.
calculateSingleSineWaveWithCutoff
(
tMin
,
tMax
,
thresholdLower
,
thresholdUpper
);
assertEquals
(
expectedResult
,
result
,
0.1
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment