How to solve this equation?
조회 수: 5 (최근 30일)
이전 댓글 표시
I have an equation that I'd like to solve for p where 0<a<1. Is there anyone who can help me with this? when I'm running my code it says "Unable to find explicit solution"
syms p a
eqn=2*(p^a)+2*(p^2)+4*(p);
s=solve(eqn,p);
댓글 수: 2
Dyuman Joshi
2023년 6월 5일
You don't have an equation, you have an expression. There is no equality in your code. You need to specify the equality and even then, there is no guarantee that solve() will be able to find an explicit symbolic solution.
Walter Roberson
2023년 6월 5일
solve() assumes an implict ==0 for expressions -- which also means that if you have equations of the form f(x)==g(x) then you can rewrite as f(x)-g(x)==0 and then drop the ==0 to pass in just f(x)-g(x)
채택된 답변
Walter Roberson
2023년 6월 5일
There are multiple solutions. p=0 is a solution for all a values, but there are also complex solutions -- and you did not rule out complex solutions.
You are not going to be able to get a closed form solution for an equation involving sums with a value to an unknown power -- except in the limited situation where the equation happens to match a pattern that can be solved with a wrightOmega
syms p
a = sym(linspace(eps, 1-eps, 20),'f')
eqns = 2*(p.^a) + 2*(p^2) + 4*(p);
sols = arrayfun(@(E)vpasolve(E,p,-100), eqns, 'uniform', 0)
hold on;
cellfun(@(A,S) plot(repmat(A, numel(S), 1), real(S), 'k+'), num2cell(a), sols);
cellfun(@(A,S) plot(repmat(A, numel(S), 1), imag(S), 'r*'), num2cell(a), sols);
hold off
a(end),sols{end}
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
