SMath Studio Forum
»
SMath Studio
»
Bugs & Problems
»
Problem? Definite integral with variable limits
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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!" |
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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!" |
|
|
|
Rank: Member Groups: Registered
Joined: 20/03/2009(UTC) Posts: 21 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
|
|
|
|
Rank: Administration Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member Joined: 11/07/2008(UTC) Posts: 1,616 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.
|
|
|
|
Rank: Administration Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member Joined: 11/07/2008(UTC) Posts: 1,616 Was thanked: 1978 time(s) in 666 post(s)
|
Here is the example of Definite Integral plotting by points:
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
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!" |
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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!" |
|
|
|
Rank: Member Groups: Registered
Joined: 20/03/2009(UTC) Posts: 21 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
|
|
|
|
Rank: Member Groups: Registered
Joined: 20/03/2009(UTC) Posts: 21 Location: Vienna, AUSTRIA
|
Oh damn!! Sorry RADOVAN!!! It was just a typo error, I swear!! Jakob
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
jakobg wrote:Oh damn!! Sorry RADOVAN!!! It was just a typo error, I swear!! Jakob Sorry Jakob, what typo ??? |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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!" |
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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 |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Administration Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member Joined: 11/07/2008(UTC) Posts: 1,616 Was thanked: 1978 time(s) in 666 post(s)
|
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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!" |
|
|
|
Rank: Member Groups: Registered
Joined: 20/03/2009(UTC) Posts: 21 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
|
|
|
|
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?
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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)*5int(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!" |
|
|
|
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.
|
|
|
|
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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,986 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): |
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Bugs & Problems
»
Problem? Definite integral with variable limits
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.