Trouble solving for extreme values of a differential equation.
Mostrar comentarios más antiguos
Hello,
I'm trying to solve the most probable energy for this probability density function, P(E) = A.*sinh(sqrt(2.*E)).*exp(-E). I solved for A in my code but when I take the derivative and try to solve it at zero I get a large, relative to the expectation, negative number. For the situation the function is from the energy cannot be negative. I'm unsure what I'm doing wrong could you help me? Here's my code:
%% Problem 3
% Part A
syms E
P = @(E) sinh(sqrt(2.*E)).*exp(-E);
A = double(1./int(P(E), 0, Inf));
disp(A);
% Part B
dPdE = @(E) diff(A.*P(E));
solution = solve(dPdE(E));
4 comentarios
darova
el 25 de Mzo. de 2021
Can you please attach the picture of expected result? What is wrong with your result now?
Patrick Myers
el 25 de Mzo. de 2021
Editada: Patrick Myers
el 25 de Mzo. de 2021
darova
el 25 de Mzo. de 2021
DO you have original equations?
Patrick Myers
el 25 de Mzo. de 2021
Editada: Patrick Myers
el 25 de Mzo. de 2021
Respuestas (1)
darova
el 25 de Mzo. de 2021
0 votos
You are trying to solve your equation symbolically (to get analytical expression). I think it's impossible
Try fsolve or vpasolve
1 comentario
Patrick Myers
el 29 de Mzo. de 2021
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!