Solve an equation, answer not solved

조회 수: 12 (최근 30일)
Hubert Coppieters 't Wallant
Hubert Coppieters 't Wallant 2020년 10월 19일
댓글: Ameer Hamza 2020년 10월 19일
I try to solve an equation but it keeps giving me long strings of operations (addition, multiplication, roots, etc...) with many digits numbers, did I do something wrong?
here is my code:
syms deltax
eqn = - (50) * (2 * sqrt(deltax^2 + (1/2)^2) - 1)^2 + (1/2)* 0.025 * 100 + deltax * (0.025 * 9.81*sin(pi*(1/8))+0.1*9.81*cos(pi*(1/8)))==0;
wortels = solve(eqn, deltax, 'Real', true)

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 19일
It is giving you symbolic solution. You are probably looking for a numeric solution. Use vpa() or double()
syms deltax
eqn = - (50) * (2 * sqrt(deltax^2 + (1/2)^2) - 1)^2 + (1/2)* 0.025 * 100 + deltax * (0.025 * 9.81*sin(pi*(1/8))+0.1*9.81*cos(pi*(1/8)))==0;
wortels = solve(eqn, deltax, 'Real', true);
wortels = double(wortels);
  댓글 수: 2
Hubert Coppieters 't Wallant
Hubert Coppieters 't Wallant 2020년 10월 19일
A thousand thanks to you!
Ameer Hamza
Ameer Hamza 2020년 10월 19일
I am glad to be of help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Elementary Math에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by