How to solve this equation?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Della
el 5 de Jun. de 2023
Respondida: Walter Roberson
el 5 de Jun. de 2023
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 comentarios
Dyuman Joshi
el 5 de Jun. de 2023
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
el 5 de Jun. de 2023
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)
Respuesta aceptada
Walter Roberson
el 5 de Jun. de 2023
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!