dsolve returns imaginary components when it shouldnt..how to fix this?
Show older comments
I am having trouble with solving 2nd order differential equation with 'dsolve':
q=1*10^3; %N/m
L=2; %m
E=200*10^9; %Pa
I=177*10^-8; %m^4
syms W(x)
W=dsolve('D2W=(1/(E*I))*((-A*x)+q*((x^2)/2))','x')
which returns solution
% solution
W =- (q*exp(-1)*x^4*1i)/24 + (A*exp(-1)*x^3*1i)/6 + C3*x + C4
when the solution should have zero imaginary components since solving by hand gives me:
% by hand
W2=(1/(E*I))*(-A*(x^3)/6+q*(x^4)/24)+C0*x+C1
Any explanation or advice?
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differentiation 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!