Wrong result when solving definite integral using SMath

Wrong result when solving definite integral using SMath - Сообщения

#1 Опубликовано: 22.04.2021 00:42:12
Victor

Victor

0 сообщений из 4 понравились пользователям.

Группа: 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 Опубликовано: 22.04.2021 01:00:20
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: 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 Опубликовано: 22.04.2021 01:50:45
Victor

Victor

0 сообщений из 4 понравились пользователям.

Группа: 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 Опубликовано: 22.04.2021 08:34:00
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 КиБ) скачан 59 раз(а).
#5 Опубликовано: 22.04.2021 19:50:26
Victor

Victor

0 сообщений из 4 понравились пользователям.

Группа: 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 Опубликовано: 22.04.2021 20:20:04
overlord

overlord

554 сообщений из 1333 понравились пользователям.

Группа: 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 Опубликовано: 22.04.2021 21:44:52
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 Опубликовано: 22.04.2021 22:14:32
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Answer and result are via in post # 4 above.



Integrate 0.1.PNG
#9 Опубликовано: 22.04.2021 23:11:13
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: 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 КиБ) скачан 55 раз(а).

Clipboard01.jpg

Best regards.
Alvaro.
1 пользователям понравился этот пост
sergio 23.04.2021 05:05:00
#10 Опубликовано: 23.04.2021 06:40:50
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: 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 Опубликовано: 23.04.2021 10:08:48
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

I have the same problem again with this definite integral.



Page17 Integrate Carlos.sm (88 КиБ) скачан 55 раз(а).

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

#12 Опубликовано: 23.04.2021 11:56:10
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 КиБ) скачан 63 раз(а).

#13 Опубликовано: 26.04.2021 01:53:21
Victor

Victor

0 сообщений из 4 понравились пользователям.

Группа: User

Thank you very much to all of you for your advices. I solved the problem. Regards.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений