Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline gfggirardi  
#1 Posted : 08 January 2013 12:17:32(UTC)
gfggirardi

Rank: Newbie

Groups: Registered
Joined: 08/01/2013(UTC)
Posts: 3
Italy

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.

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline omorr  
#2 Posted : 08 January 2013 16:07:20(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

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!"
Offline callmeishmael  
#3 Posted : 08 January 2013 19:13:48(UTC)
callmeishmael


Rank: Member

Groups: Registered
Joined: 29/04/2010(UTC)
Posts: 15
Man
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
Offline gfggirardi  
#4 Posted : 08 January 2013 19:59:36(UTC)
gfggirardi

Rank: Newbie

Groups: Registered
Joined: 08/01/2013(UTC)
Posts: 3
Italy

Thank you very much for your answer,
I've attached a file that's explaining the error that I get.
File Attachment(s):
resource1.sm (14kb) downloaded 60 time(s).
Offline Davide Carpi  
#5 Posted : 08 January 2013 20:14:02(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: gfggirardi Go to Quoted Post
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...) Good

Edited by user 08 January 2013 20:15:47(UTC)  | Reason: Not specified

Davide Carpi attached the following image(s):
SMath Studio - [resource1.sm].png
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline kilele  
#6 Posted : 08 January 2013 21:42:35(UTC)
kilele


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):
integralunits.png
thanks 1 user thanked kilele for this useful post.
on 09/01/2013(UTC)
Offline gfggirardi  
#7 Posted : 09 January 2013 12:03:04(UTC)
gfggirardi

Rank: Newbie

Groups: Registered
Joined: 08/01/2013(UTC)
Posts: 3
Italy

Thank you very much for your suggestions: now the formula is working correctly.
Offline zapzapouch  
#8 Posted : 12 November 2014 21:02:20(UTC)
zapzapouch


Rank: Member

Groups: Registered
Joined: 03/07/2014(UTC)
Posts: 27
United States

Originally Posted by: kilele Go to Quoted Post
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):
integral.png
smath integral.png
Offline PompelmoTell  
#9 Posted : 12 November 2014 22:14:37(UTC)
PompelmoTell


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2011(UTC)
Posts: 319
Man
Italy
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
Offline zapzapouch  
#10 Posted : 12 November 2014 23:13:44(UTC)
zapzapouch


Rank: Member

Groups: Registered
Joined: 03/07/2014(UTC)
Posts: 27
United States

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.
Offline brotjob  
#11 Posted : 13 November 2014 09:32:05(UTC)
brotjob


Rank: Advanced Member

Groups: Registered
Joined: 18/09/2014(UTC)
Posts: 71
Switzerland

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):
int_with_units.png
Offline zapzapouch  
#12 Posted : 13 November 2014 18:33:13(UTC)
zapzapouch


Rank: Member

Groups: Registered
Joined: 03/07/2014(UTC)
Posts: 27
United States

..assuming you have the Maxima plugin installed and Maxima installed?
Users browsing this topic
Guest
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.