Borrar filtros
Borrar filtros

How to find real and complex roots for a nonlinear equation

7 visualizaciones (últimos 30 días)
Marco Dellacasa
Marco Dellacasa el 21 de Sept. de 2021
Comentada: Marco Dellacasa el 22 de Sept. de 2021
Hi everyone,
I have to solve this eqution numerically:
the only variable is H and it tipically gives two complex roots and one real root, I've read that fzero is not suitable in this case, could anyone give mi any tips please?
Thank you

Respuestas (1)

Viranch Patel
Viranch Patel el 22 de Sept. de 2021
For simplicity I have taken a simple function which has complex roots.
syms H
eq=H^2 + 1;
solve(eq==0,H)
You can specify your equation in H like this and this should give you the roots correctly.
  1 comentario
Marco Dellacasa
Marco Dellacasa el 22 de Sept. de 2021
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
> In sym/solve (line 304)
In prova_Irvine (line 15)
ans =
-8530666.6665264117623777679822889
>>
Unfortunately it didn't work, I know a priori that usually this equation has in total 3 roots: 2 complex and 1 real, maybe the problem is that I have both real and complex roots to find instead only real or only complex roots?

Iniciar sesión para comentar.

Categorías

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

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by