Borrar filtros
Borrar filtros

Symbolic Integration Bug?

2 visualizaciones (últimos 30 días)
Baha411
Baha411 el 3 de Mayo de 2019
Respondida: Walter Roberson el 3 de Mayo de 2019
Hi All,
Is this a bug of symbolic toolbox? It is kind of messing up when changing the signs.
clear all; clc;
syms x L1 L2;
L1val = 10;
L2val = 20;
Ma = -(x-L1)^2;
Mb = -(x^2+L1^2-2*x*L1);
Maint = int(Ma, x);
Mbint = int(Mb, x);
vpa(subs(subs(Maint, L1, L1val),x, 1))
vpa(subs(subs(Mbint, L1, L1val),x, 1))
ans =
243.0
ans =
-90.333333333333333333333333333333
Regards,
Baha

Respuesta aceptada

Walter Roberson
Walter Roberson el 3 de Mayo de 2019
No bug. You are doing indefinite integration, which is permitted to have a constant of integration. You are evaluating at a single point rather than evaluating the difference between two locations, so the constant of integration is included in the value. It is permitted for the two forms to generate two different constants of integration.
If you were to
syms a
Maint = int(Ma, x, a, x);
Mbint = int(Mb, x, a, x);
then you would get the same result for the two.

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by