Wrong result when solving definite integral using SMath

Wrong result when solving definite integral using SMath - Mensajes

#1 Publicado: 22/4/2021 0:42:12
Victor

Victor

0 me gusta en 4 mensajes.

Grupo: 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 Publicado: 22/4/2021 1:00:20
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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 Publicado: 22/4/2021 1:50:45
Victor

Victor

0 me gusta en 4 mensajes.

Grupo: 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 Publicado: 22/4/2021 8:34:00
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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,63 KiB) descargado 1882 vez(es).
#5 Publicado: 22/4/2021 19:50:26
Victor

Victor

0 me gusta en 4 mensajes.

Grupo: 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 Publicado: 22/4/2021 20:20:04
overlord

overlord

600 me gusta en 1.381 mensajes.

Grupo: 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 Publicado: 22/4/2021 21:44:52
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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 Publicado: 22/4/2021 22:14:32
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

Answer and result are via in post # 4 above.



Integrate 0.1.PNG
#9 Publicado: 22/4/2021 23:11:13
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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,46 KiB) descargado 1557 vez(es).

Clipboard01.jpg

Best regards.
Alvaro.
A 1 usuarios les gustó este mensaje
sergio 23/4/2021 5:05:00
#10 Publicado: 23/4/2021 6:40:50
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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 Publicado: 23/4/2021 10:08:48
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

I have the same problem again with this definite integral.



Page17 Integrate Carlos.sm (88,08 KiB) descargado 1829 vez(es).

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

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

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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,48 KiB) descargado 1749 vez(es).

#13 Publicado: 26/4/2021 1:53:21
Victor

Victor

0 me gusta en 4 mensajes.

Grupo: User

Thank you very much to all of you for your advices. I solved the problem. Regards.
  • Nuevos mensajes
  • Sin mensajes nuevos