フィルターのクリア

Symbolic Integration Bug?

2 ビュー (過去 30 日間)
Baha411
Baha411 2019 年 5 月 3 日
回答済み: Walter Roberson 2019 年 5 月 3 日
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

採用された回答

Walter Roberson
Walter Roberson 2019 年 5 月 3 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by