expanded vs unexpanded polynomials in symbolic integrals
Show older comments
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))
Accepted Answer
More Answers (0)
Categories
Find more on Common Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!