Matlab ilaplace not working properly
조회 수: 4 (최근 30일)
이전 댓글 표시
How can I make matlab return the answer directly and automaticaly?
ilaplace(40/(s*(2*s^3 + s^2 + 6*s + 2)))
% matlab just answers 20 - 40*symsum((exp(t*root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k))*root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k)^2)/(2*(root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k) + 3*root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k)^2 + 3)), k, 1, 3) - 120*symsum(exp(t*root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k))/(2*(root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k) + 3*root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k)^2 + 3)), k, 1, 3) - 20*symsum((exp(root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k)*t)*root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k))/(2*(root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k) + 3*root(s3^3 + s3^2/2 + 3*s3 + 1, s3, k)^2 + 3)), k, 1, 3)
댓글 수: 0
채택된 답변
Paul
2024년 11월 24일
편집: Paul
2024년 11월 24일
ilaplace can return a closed form, symbolic expression if we give it some help, though it's a bit of a mess. Unclear why it needs such help
syms s
syms t real
F(s) = (40/(s*(2*s^3 + s^2 + 6*s + 2)));
[num,den] = numden(simplify(F(s)));
num,den
num = num/2; den = den/2;
P = solve(den,'MaxDegree',3),disp(char(P))
f(t) = ilaplace(num/prod(s-P));
f(t) = simplify(real(rewrite(f(t),'sincos'))),disp(char(f(t)))
vpa(f(t),2),disp(char(ans))
figure
fplot(f(t),[0 100]),grid
댓글 수: 0
추가 답변 (1개)
Walter Roberson
2024년 11월 25일
편집: Walter Roberson
2024년 11월 25일
syms s
sol = ilaplace(40/(s*(2*s^3 + s^2 + 6*s + 2)))
disp(char(sol))
fullsol = rewrite(rewrite(sol, 'expandsum'), 'expandroot')
disp(char(fullsol))
You can simplify() this, but to be honest the result is more messy.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
