Forcing matlab to simplify symbolic expression

2 visualizaciones (últimos 30 días)
noMathWiz
noMathWiz el 7 de Mayo de 2020
Comentada: Star Strider el 7 de Mayo de 2020
How do I get matlab to simplify this answer in the script?
c = 3e8;
h = 6.626e-34;
k = 1.38e-23;
syms l T
eqn = exp((h*c)/(l * k * T)) * (((h*c)/(l * k * T)) -5) + 5 == 0;
lmax = solve(eqn, l)
lmax =
2886030032919217/(200358257643048576*T*(lambertw(0, -5*exp(-5)) + 5))
I can take out the symbolic variable "T" within the lmax answer and matlab easily calculates a simple answer. What gives?

Respuesta aceptada

Star Strider
Star Strider el 7 de Mayo de 2020
Use the vpa function:
lmax = vpa(solve(eqn, l))
produces:
lmax =
0.0029011110628620153129357555503486/T
It is not possible to use vpasolve in this expression. The vpa function must be called separately.
  2 comentarios
noMathWiz
noMathWiz el 7 de Mayo de 2020
Thank you!
Star Strider
Star Strider el 7 de Mayo de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematical Functions en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by