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

Notification

Icon
Error

Login


2 Pages12>
Options
Go to last post Go to first unread
Offline omorr  
#1 Posted : 23 July 2009 01:58:15(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 Andrey,

Please look at the picture:

I can not understand this. There must be something in the definite integral realization in SMath.
1. The function defined F(x) as definite integral with variable limit x can be defined
2. Calling this function will give the result
3. Plotting of this function is not possible???
4. Solve, f.e. with this function will not give the result???

Could you give me some hints what is this about?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"

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

Offline omorr  
#2 Posted : 23 July 2009 02:13:52(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)
On the other hand, this is working

But, this is wrong???

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline jakobg  
#3 Posted : 23 July 2009 03:33:49(UTC)
jakobg


Rank: Member

Groups: Registered
Joined: 20/03/2009(UTC)
Posts: 21
Man
Location: Vienna, AUSTRIA

Hi Radovan,

I think the problem you have found is issued in a topic before (see: http://en.smath.info/for...lt.aspx?g=posts&t=85)
The definite integral is only nummerically implemented so far (at least it was the days when the other post was written), therefore it is impossible to plot the solution of a definite integral. Of course there is no problem with numerically solving it.
If you try to symbolically solve your integral, there will be an error (limits must be real).

So currently it is simply not possible to symbolically integrate.

But why the plot is wrong, Andrey has to answer.

Ciao Jakob
Offline Andrey Ivashov  
#4 Posted : 23 July 2009 06:35:23(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
About wrong plot results in the second example: do you really sure in your example? I thing you should use F(x)←int(t^3+10;t;0;x) instead of F(x)←int(x^3+10;x;0;x).

And about integral: evaluation of integral in SMath Studio is numeric, but some actions that you test requires symbolic result of the expression inside. That's why you can't evaluate some stuff in your first calculation. jakobg pointed this rightly.
Offline Andrey Ivashov  
#5 Posted : 23 July 2009 07:16:22(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Here is the example of Definite Integral plotting by points:
Offline omorr  
#6 Posted : 23 July 2009 13:23:24(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)
jakobg wrote:

I think the problem you have found is issued in a topic before (see: http://en.smath.info/for...lt.aspx?g=posts&t=85)

Thanks Jacob. Unfortunately, I can not access this topic (access is denied for me ??)
jakobg wrote:

The definite integral is only nummerically implemented so far (at least it was the days when the other post was written), therefore it is impossible to plot the solution of a definite integral. Of course there is no problem with numerically solving it.
If you try to symbolically solve your integral, there will be an error (limits must be real).

So currently it is simply not possible to symbolically integrate.

I understand all of this. About plotting, you are right - my mistake, sorry.
I am not sure about "solve" function. It seems that the function for which we are finding roots must be also given analitically. I am not sure but I made some example that involved summation. "Solve" did not solve the original function until I represent it symbolically using SMath.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline omorr  
#7 Posted : 23 July 2009 13:50:02(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)
smath wrote:
About wrong plot results in the second example: do you really sure in your example? I thing you should use F(x)←int(t^3+10;t;0;x) instead of F(x)←int(x^3+10;x;0;x).

And about integral: evaluation of integral in SMath Studio is numeric, but some actions that you test requires symbolic result of the expression inside. That's why you can't evaluate some stuff in your first calculation. jakobg pointed this rightly.


Thanks Andrey,

I understood that. I intentionally put this, because many times this happened to my students in Mathcad. I was expecting that some error should be issued in SMath with this expression when, say, plotting it.
F(x)←int(x^3+10;x;0;x)
But, it worked and I was puzzled about it?. In the first place, how this could be plotted (wrongly) considering the rules about plotting and definite integral as numerically solved?
This might cause problems in Mathcad in spite of that it could solve it analitically, until you use the correct expression (the limit variable should not be the same as the variable in the primitive function) say
F(x)←int(t^3+10;t;0;x)

Your example about plotting the function with definite integrals is quite understandable and this plot is right, but please take a look at your (correct) plot and the one I mentioned incorrect (the blue line represents F(x)). What is this about?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline jakobg  
#8 Posted : 23 July 2009 13:51:35(UTC)
jakobg


Rank: Member

Groups: Registered
Joined: 20/03/2009(UTC)
Posts: 21
Man
Location: Vienna, AUSTRIA

Hi Radovan,

I see what you mean with this Solve function. Well I think the Solve function uses something like a Newton sceme to find the roots and therefore the function itself (and not just a few Points - if solved numerically) is necessary to solve the equation. So if you try the line solve(F(x),x,-4,0) SMath might intent to build something like dF(x)/dx which is not available symbolical! And therefore there is no way to solve this.

Ciao
Jakob

Edited by user 25 July 2009 03:25:18(UTC)  | Reason: Not specified

Offline jakobg  
#9 Posted : 23 July 2009 13:53:15(UTC)
jakobg


Rank: Member

Groups: Registered
Joined: 20/03/2009(UTC)
Posts: 21
Man
Location: Vienna, AUSTRIA

Oh damn!! Sorry RADOVAN!!! It was just a typo error, I swear!! Good
Jakob
Offline omorr  
#10 Posted : 23 July 2009 13:56:59(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)
jakobg wrote:
Oh damn!! Sorry RADOVAN!!! It was just a typo error, I swear!! Good
Jakob

Sorry Jakob, what typo ???
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline omorr  
#11 Posted : 23 July 2009 14:03:37(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)
jakobg wrote:

Well I think the Solve function uses something like a Newton sceme to find the roots and therefore the function itself (and not just a few Points - if solved numerically) is necessary to solve the equation.


If this is the case i.e. Newton like procedure with analitical derivatives, it is quite understandable then.

Thanks Jakob,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline omorr  
#12 Posted : 23 July 2009 15:22:40(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)
omorr wrote:

I am not sure about "solve" function. It seems that the function for which we are finding roots must be also given analitically. I am not sure but I made some example that involved summation. "Solve" did not solve the original function until I represent it symbolically using SMath.

Actually, I was wrong - sorry Confusion

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Andrey Ivashov  
#13 Posted : 23 July 2009 20:18:55(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
omorr, thanks for the example above. I think jakobg talk about typo in the url. Here is a right one: http://en.smath.info/for...lt.aspx?g=posts&t=85
Offline omorr  
#14 Posted : 23 July 2009 20:40:48(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)
You are welcome and thank you;

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline jakobg  
#15 Posted : 24 July 2009 05:10:05(UTC)
jakobg


Rank: Member

Groups: Registered
Joined: 20/03/2009(UTC)
Posts: 21
Man
Location: Vienna, AUSTRIA

Hi,

well, actually my typo was something different, but if nobody "found" it, I am not going to mention it here.
An interesting topic is, I have copied the url from my adress bar and I too get the error access denied.
Thanks Andrey for the link, this was the post I was talking about.

Ciao Jakob
Offline sleschke  
#16 Posted : 19 February 2010 22:12:51(UTC)
sleschke


Rank: Member

Groups: Registered
Joined: 05/02/2009(UTC)
Posts: 13
Location: Germany

Hello Andrey,

I just came across a related problem with definite integrals.
I tried to calculate a definite integral of a piecewise linear function.

Therefor I have defined a function

f(x):= if x <5
3
else
5

If I try to calculate the integral from 0 to 10 of f(x) dx
I get the message that x is undefined.

Regards
Stephan

P.S. I still have no idea how to insert screen shots.
Is there any tutorial about this?
Offline omorr  
#17 Posted : 20 February 2010 01:23:39(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 Stephan,
sleschke wrote:
Therefor I have defined a function

f(x):= if x <5
3
else
5

If I try to calculate the integral from 0 to 10 of f(x) dx
I get the message that x is undefined.

It was mentioned in some other posts (for example "int" does not like "if"?) I suppose this is due to the internal SMath
numerical integration. If you want to integrate a discontineous function try something like this:
f(x)←(x<5)*3+(x≥5)*5
int(f(x);x;-4;8)=42,04
(Pay attention on the numerical error, the result is 42 actually. Try to avoid using this or see the example on Wiki)
sleschke wrote:

P.S. I still have no idea how to insert screen shots.
Is there any tutorial about this?

Put it on some free file hosting and make a link to it via "Create link" tool when posting.

Regards,
Radovan

Edited by user 20 February 2010 01:50:06(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Greg Locock  
#18 Posted : 20 February 2010 05:28:35(UTC)
Greg Locock


Rank: Advanced Member

Groups: Registered
Joined: 30/08/2009(UTC)
Posts: 52
Location: Australia

Another alternative would be to add a page to the wiki with your note, and then upload a file or screenshot there.
Offline sleschke  
#19 Posted : 20 February 2010 16:12:13(UTC)
sleschke


Rank: Member

Groups: Registered
Joined: 05/02/2009(UTC)
Posts: 13
Location: Germany

Hello Radovan,

thank you very much for the quick reply and the helpful links.
I will try to split my definite integral into sections where my function is continous.

Regards
Stephan

Also thanks to Greg for the hint with the wiki.
Offline mkraska  
#20 Posted : 26 July 2013 13:17:28(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
There still (as of 0.96.4909) seems to be a problem to plot functions involving definite integrals. You have to embed them into eval(), otherwise they give a useless error message (claiming that the integration variable is not defined)

The X-Y Plot plugin does not seem to have that problem. A workaround might be to apply eval() for expressions to be plot
by default. At least I am not aware of counter-indications.
mkraska attached the following image(s):
intplot.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Users browsing this topic
Guest
2 Pages12>
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.