Quantcast
Channel: Active questions tagged units - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 41

Integrate & Unit: unable to determine the units of quantities

$
0
0

In a Wolfram Notebook,

I declare a function F1[x]=1/x where x is in "Meters"

F1[X_] = With[{x=Quantity[X,"Meters"]},1/x]

I integrate F1. Everything is Ok.

NIntegrate[F1[r],{r,1,2}]

But with the function F2[x]=1/(1-x)

F2[X_] = With[{x=Quantity[X,"Meters"]},1/(1-x)]

Integrating F2 gives an error.

NIntegrate[F2[r],{r,1,2}]

"NIntegrate:NIntegrate was unable to determine the units of quantities that appear in the input."

How can I set units for a function of the type 1/(1-x) and integrate it?


Viewing all articles
Browse latest Browse all 41

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>