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 Victor Martinez  
#1 Posted : 22 April 2021 06:42:12(UTC)
Victor Martinez

Rank: Newbie

Groups: Registered
Joined: 22/04/2021(UTC)
Posts: 4
Honduras

When trying to solve the following definite integral using Smath, the result returned by Smath is incorrect. Can somebody help me, please?


int(1/sqrt((1/3600)+(0.8*t)),t,0,4)

Incorrect result.png


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

Offline Razonar  
#2 Posted : 22 April 2021 07:00:20(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. It's a numeric issue of the numerical procedure for integration. Try to change "Integral accuracy" option ... from 100 to 10000. Ok, that make it very slow.

Clipboard02.jpg

Chau.
Alvaro.
Offline Victor Martinez  
#3 Posted : 22 April 2021 07:50:45(UTC)
Victor Martinez

Rank: Newbie

Groups: Registered
Joined: 22/04/2021(UTC)
Posts: 4
Honduras

Originally Posted by: Razonar Go to Quoted Post
Hi. It's a numeric issue of the numerical procedure for integration. Try to change "Integral accuracy" option ... from 100 to 10000. Ok, that make it very slow.

Clipboard02.jpg

Chau.
Alvaro.


It works! Thank you very much, Alvaro! Regards!

Edited by moderator 22 April 2021 14:49:58(UTC)  | Reason: Marked as SOLVED (not a bug)

Offline Jean Giraud  
#4 Posted : 22 April 2021 14:34:00(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Victor Martinez Go to Quoted Post
When trying to solve the following definite integral using Smath, the result returned by Smath is incorrect.

1. Always plot the integrand
2. Try Wolfram Alpha
3. Use Smath Carlos ... hyperfast/accurate
Cheers ... Jean

Page17 Integrate Carlos.sm (85kb) downloaded 16 time(s).
Offline Victor Martinez  
#5 Posted : 23 April 2021 01:50:26(UTC)
Victor Martinez

Rank: Newbie

Groups: Registered
Joined: 22/04/2021(UTC)
Posts: 4
Honduras

I have the same problem again with this definite integral. I have tried to change the "Integral accuracy" but it hasn't worked. Can you help me please? Thank you.

Incorrect result 2.png
Offline overlord  
#6 Posted : 23 April 2021 02:20:04(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
Originally Posted by: Victor Martinez Go to Quoted Post
When trying to solve the following definite integral using Smath, the result returned by Smath is incorrect. Can somebody help me, please?
int(1/sqrt((1/3600)+(0.8*t)),t,0,4)

Originally Posted by: Victor Martinez Go to Quoted Post
I have the same problem again with this definite integral. I have tried to change the "Integral accuracy" but it hasn't worked. Can you help me please? Thank you.
int(1/(2*sqrt(x^2-0.01)),x,0.1,0.2)

Try to use maple or maxima plugin.
Regards

2021-04-23_02-15.png
Offline Jean Giraud  
#7 Posted : 23 April 2021 03:44:52(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Victor Martinez Go to Quoted Post
I have the same problem again with this definite integral. I have tried to change the "Integral accuracy" but it hasn't worked. Can you help me please? Thank you.

Answer and result are via in post # 4 above.

Offline Jean Giraud  
#8 Posted : 23 April 2021 04:14:32(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Answer and result are via in post # 4 above.


Integrate 0.1.PNG
Offline Razonar  
#9 Posted : 23 April 2021 05:11:13(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Victor Martinez Go to Quoted Post
I have the same problem again with this definite integral. I have tried to change the "Integral accuracy" but it hasn't worked. Can you help me please? Thank you.

Incorrect result 2.png


Hi. The problem with your example, now, isn't the bad integration, it's that it give you a number, not a an error. Notice that the integrand isn't continue at x = 0.1, it's undefined or infinity, because you divide by zero there.

As Overlord points, you can use Maple or Maxima for handle this kind of problems.

ImproperIntegral.sm (10kb) downloaded 9 time(s).

Clipboard01.jpg

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 23/04/2021(UTC)
Offline Razonar  
#10 Posted : 23 April 2021 12:40:50(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Perhaps these examples can give the false impression that SMath is not the right tool to solve these kinds of problems. Nothing further from reality. Surely someone for some reason has recommended SMath to solve them, knowing that you would encounter these difficulties.

There are many numerical methods to calculate integrals, some more robust, others more specialized in some characteristic of the integrand, such as its continuity or lack of it, or the speed of its growth, or the number of times it changes. But all will fail at some point, and it will always be possible to find counterexamples that expose those failures.

SMath is not a personal assistant who seeks to take control of your life, it is a tool, as a simple hammer can be. And if you don't know how to use it, you can hurt your fingers. And it is also a tool for a particular type of problem, which are those aimed at solving practical engineering questions. That is, it is not the best tool to prove theorems, or perform calculations in Galois algebras, or visualize astronomical or medical images to discover patterns.

In the practical realization of the calculations to which SMath is directed, which you can call "calculation memories" to leave a written but visually friendly record of how the technical characteristics of an element or electrical, mechanical, chemical or any other structure were deduced.

For example, suppose that the solution involves solving an integral that is determined with any of the so-called "special functions", that is, those that are written as integrals since those integrals cannot be expressed as finite combinations of simpler functions. Well, these special functions also have numerical implementation problems and we will have to consider the validity of their results once they are found.

For this, the stability and other characteristics of the solutions found are usually studied later. The study of the stability, for example, of a system of linear equations (and therefore of all engineering problems that are solved by this method) can be carried out by means of the so-called "condition numbers". However, another way to do it, simpler, is to analyze if using Cramer's method the determinant of the system, without being null, was very small, since then small variations in the parameters of the system under study would generate very wide variations in the response. system, which is usually not what you want.

The correct way to study the stability of an integral, as far as engineering is concerned, is given by transforming the integral into a differential equation to have all the theoretical and numerical tools of that theory. You may not have studied that topic yet, but surely you will soon. Here is an example of how to evaluate an integral using Rkadapt, one of the most used methods of the so-called odesolvers.

On the other hand, it is very true that it is very impractical for SMath not to detect that x ^ 2-0.01 is zero for x = 0.1 because then it is not in a position to detect that the integral is improper and to select a good method for its numerical calculation.

Best regards.
Alvaro.
Offline Jean Giraud  
#11 Posted : 23 April 2021 16:08:48(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Victor Martinez Go to Quoted Post
I have the same problem again with this definite integral.


Page17 Integrate Carlos.sm (89kb) downloaded 8 time(s).

In some instances, Adaptive is of no profit, but not detrimental.

Offline Jean Giraud  
#12 Posted : 23 April 2021 17:56:10(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Read more ...
1. ODE solvers are integrator [visit Alvaro/Viacheslav example]
2. FD [Finite Differences] are very true for data set, insensible to noise.
3. The Romberg kernel allows independent acc [n] for each integration.
Most profitable for long range of the variable of integration.
Please, don't hesitate for more ... Jean

Integral COMPANION Adaptive Romberg-Simpson(f,a,b,n).sm (271kb) downloaded 12 time(s).

Offline Victor Martinez  
#13 Posted : 26 April 2021 07:53:21(UTC)
Victor Martinez

Rank: Newbie

Groups: Registered
Joined: 22/04/2021(UTC)
Posts: 4
Honduras

Thank you very much to all of you for your advices. I solved the problem. Regards.
Users browsing this topic
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.