Comments (12)
Measurements.derivative.(x^2*y^2+2*x^3*y, [x, y])
That is a weird call, where did you get it?
derivative
takes either a single Measurement
argument + tag, or two Measurement
arguments:
Lines 40 to 56 in 5533272
I'm not sure what you are trying to do, more generally.
#144 might be relevant.
from measurements.jl.
Hi, thanks for the answer. I took the example from here, it is this example:
Measurements.derivative.(log1p(x) + y^2 - cos(x/y), [x, y, z])
Am I interpreting something wrongly?
My objective is to use Measurements.jl as a AD tool for functions that depend on unitful quantities.
from measurements.jl.
Hm, works for me:
$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.9.2 (2023-07-05)
_/ |\__'_|_|_|\__'_| |
|__/ |
julia> using Measurements
julia> x = 98.1 ± 12.7
98.0 ± 13.0
julia> y = 105.4 ± 25.6
105.0 ± 26.0
julia> z = 78.3 ± 14.1
78.0 ± 14.0
julia> Measurements.derivative(2x - 4y, x)
2.0
julia> Measurements.derivative(2x - 4y, y)
-4.0
julia> Measurements.derivative.(log1p(x) + y^2 - cos(x/y), [x, y, z])
3-element Vector{Float64}:
0.017700515090289737
210.7929173496422
0.0
Perhaps you have too old julia/Measurements package?
from measurements.jl.
As it can be seen in
https://github.com/JuliaPhysics/Measurements.jl/blob/55332725ad6826cef711103de7a2413c3b1b1fd6/ext/MeasurementsUnitfulExt.jl
only the main public interface is unit-aware.
from measurements.jl.
Hi. I do not understand which functions are part of the main public interface and which not. Thanks
from measurements.jl.
Hi. I do not understand what it means.
The error you are getting is correct, Measurements.jl
does not support
calling derivative()
with an Unitful
arguments, only with Measurement
s.
from measurements.jl.
I thought that measurements could have units, like
x = (98.1 ± 12.7)u"km"
y = (105.4 ± 25.6)*u"km"
Do you say that derivative()
only accepts measurements without units?
from measurements.jl.
I thought that measurements could have units, like
x = (98.1 ± 12.7)u"km" y = (105.4 ± 25.6)*u"km"
Do you say that
derivative()
only accepts measurements without units?
The thing is that is not a measurement with units,
it's a Measurement
-typed value inside of an AbstractUnit
-typed value,
and derivative()
is missing special-handling to unwrap
the outer AbstractUnit
type to get to the actual Measurement
inside.
from measurements.jl.
Ok, just to understand, could you give me an example of a "measurement with units" that Measurement.jl understands ?
from measurements.jl.
All normal mathematical operations work, only the functionality that is defined in https://github.com/JuliaPhysics/Measurements.jl/blob/c12fb10d3deef0251d671028dfccb3faa9c880dd/src/utils.jl does not.
from measurements.jl.
#152 kind-of helps,
but i'm not sure yet how to actually deal with unit mismatch in derivative()
.
from measurements.jl.
Thank you very much
from measurements.jl.
Related Issues (20)
- Adding measurement components back to a measurement after iteratively solving for a value HOT 7
- [FR] Plot recipe: ribbon plots option beside error bars HOT 11
- tryparse for Measurement type
- Can't use unique with measurements HOT 1
- Measurements with missing errors HOT 4
- Measurements.value(x::Missing) = missing HOT 1
- Integration with Zygote
- `weightedmean()` returns `NaN ± 0`? HOT 1
- Use auto-differentiation engine
- Bad integration with Plots' boxplot HOT 2
- Move to pkgextensions for Julia v1.9+
- one(measurement) should return 1, not 1 ± 0 HOT 8
- `Symbolics.jl` support? HOT 7
- Plotting mixture of measurements and missing data HOT 1
- Is there an autodiff package that is compatible? HOT 3
- Broken `MeasurementsJunoExt.jl` HOT 1
- Julia 1.6 incompatibility from stdlib compat bounds HOT 2
- Wrong values when multiplication with scalar? HOT 3
- Distinguishing between statistical and systematic errors in Measurements.jl HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from measurements.jl.