Wrong result when solving definite integral using SMath

Wrong result when solving definite integral using SMath - Messages

#1 Posted: 4/22/2021 12:42:12 AM
Victor

Victor

0 likes in 4 posts.

Group: User

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


#2 Posted: 4/22/2021 1:00:20 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

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.
#3 Posted: 4/22/2021 1:50:45 AM
Victor

Victor

0 likes in 4 posts.

Group: User

Wrote

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!
#4 Posted: 4/22/2021 8:34:00 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

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 (84 KiB) downloaded 59 time(s).
#5 Posted: 4/22/2021 7:50:26 PM
Victor

Victor

0 likes in 4 posts.

Group: User

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
#6 Posted: 4/22/2021 8:20:04 PM
overlord

overlord

554 likes in 1333 posts.

Group: Moderator

Wrote

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)


Wrote

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
#7 Posted: 4/22/2021 9:44:52 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

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.

#8 Posted: 4/22/2021 10:14:32 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Answer and result are via in post # 4 above.



Integrate 0.1.PNG
#9 Posted: 4/22/2021 11:11:13 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Wrote

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 (9 KiB) downloaded 54 time(s).

Clipboard01.jpg

Best regards.
Alvaro.
1 users liked this post
sergio 4/23/2021 5:05:00 AM
#10 Posted: 4/23/2021 6:40:50 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

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.
#11 Posted: 4/23/2021 10:08:48 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

I have the same problem again with this definite integral.



Page17 Integrate Carlos.sm (88 KiB) downloaded 53 time(s).

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

#12 Posted: 4/23/2021 11:56:10 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

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 (270 KiB) downloaded 63 time(s).

#13 Posted: 4/26/2021 1:53:21 AM
Victor

Victor

0 likes in 4 posts.

Group: User

Thank you very much to all of you for your advices. I solved the problem. Regards.
  • New Posts New Posts
  • No New Posts No New Posts