expanded vs unexpanded polynomials in symbolic integrals
이전 댓글 표시
I was doing some simple kinematics equations in matlab and I was getting the wrong answer for a long time until I expanded my function before integration using expand(). Is there a reason for this?
This was my orginial code which outputs position as 144.3144 meters
time = 2; %sec
m = 0.183; %kg
g = 9.81; %m/s^2
syms t
T = 15 - 15 * (t-1)^2; %N
aT = T/m;
a = aT - g;
v = int(a);
x = int(v);
position = double(subs(x,t,time))
This is the code I ended up using with the added expand() function which outputs position as 89.6696 meters
time = 2; %sec
m = 0.183; %kg
g = 9.81; %m/s^2
syms t
T = 15 - 15 * expand((t-1)^2); %N
aT = T/m;
a = aT - g;
v = int(a);
x = int(v);
position = double(subs(x,t,time))
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!