SMath Studio Forum
»
SMath Studio
»
Questions
»
Integral with measurement units
Rank: Newbie
Groups: Registered
Joined: 08/01/2013(UTC) Posts: 3
|
Hello everybody. I'm using a definite integral of a function with a variable defined with measurement unit. When I try to obtain the value of the integral I get an error saying that the variable is not defined. I tried removing the measurement unit dividing the variable by the measurement unit itself but I get the same error.
Thank you very much for any suggestion.
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, I would generally discourage using units in solving definite integrals by SMath. This method was not meant to be used with units, AFAIK. On the other hand, this might be a source of mistakes and confusions. Regards, Radovan Edited by user 08 January 2013 16:11:42(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Member Groups: Registered
Joined: 29/04/2010(UTC) Posts: 15 Location: Italy Was thanked: 4 time(s) in 2 post(s)
|
omorr, this time I disagree with you. A definite integral of a physical quantity is perfectly defined and has strong meaning. No mistakes should be expected in the undestanding of such integrals. I can understand that for technical reasons this may be not (yet) implemented on SMath, but in that case it would be much better to prevent the user, raising an error if a definite integral is used with units. Actual behavior is wrong. For example I defined V0=20 m/s t1=0 s t2=10 s
The definite integral of V0*dt with t from t1 to t2 is the space traveled at the constant V0 speed in t2-t1=10s. I should get meters, instead the result of the integral is still a speed. May be I'm a bit oversimplifying, but the resulting unit shall simply be the unit of the function multiplied the unit of the boundaries (which shall be the same). It should be not too hard to be implemented.
Thanks :-)
Andrea
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 08/01/2013(UTC) Posts: 3
|
Thank you very much for your answer, I've attached a file that's explaining the error that I get.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,648 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Originally Posted by: gfggirardi Thank you very much for your answer, I've attached a file that's explaining the error that I get. This should be correct (I hope...) Edited by user 08 January 2013 20:15:47(UTC)
| Reason: Not specified Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 30/03/2011(UTC) Posts: 393
Was thanked: 132 time(s) in 113 post(s)
|
Good point:If your function involves units you must specify units on the independent variables when calling the function. Edit: Anyway on my sample the integral seems problematic dealing with units, since it should return square meters. Edit2: Sorry for the confussion, the integral works fine here! I wanted to assign units to the result taking into account the geometrical interpretation of line integral, similarly Callmeishmael referred to units for the physical meaning of velocity. Edited by user 08 January 2013 23:48:56(UTC)
| Reason: Not specified kilele attached the following image(s):
|
1 user thanked kilele for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 08/01/2013(UTC) Posts: 3
|
Thank you very much for your suggestions: now the formula is working correctly.
|
|
|
|
Rank: Member Groups: Registered
Joined: 03/07/2014(UTC) Posts: 27
|
Originally Posted by: kilele Good point: If your function involves units you must specify units on the independent variables when calling the function. I don't understand. If you have a constant power dissipation of 1 W for 1 second, you will consume 1 J of energy. To write this in integral form: [see attached image] int(1 W, dt, 1 sec, 2 sec) should equal 1 W * (2 sec - 1 sec) = 1 J So why can't we use units in the limits of the integral? Edited by user 12 November 2014 21:13:24(UTC)
| Reason: Not specified zapzapouch attached the following image(s):
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/12/2011(UTC) Posts: 319 Location: italy Was thanked: 109 time(s) in 93 post(s)
|
Problems with the integrals are known. You can find more details in the Interactive SMath Handbook (author Martin Kraska). At the moment, your problem can be solved as in attached figure sergio
|
|
|
|
Rank: Member Groups: Registered
Joined: 03/07/2014(UTC) Posts: 27
|
So you're basically removing the units before the integral and then re-adding them after it's done? What does LE stand for and why is it blue like a unit for you? It's not for me.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 18/09/2014(UTC) Posts: 71 Was thanked: 7 time(s) in 7 post(s)
|
The approach posted by PompelmoTell is now obsolete. Do like in the example attached. To create your own units you start with an apostroph: 'LE gives you the blue colour. brotjob attached the following image(s):
|
|
|
|
Rank: Member Groups: Registered
Joined: 03/07/2014(UTC) Posts: 27
|
..assuming you have the Maxima plugin installed and Maxima installed?
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Integral with measurement units
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.