Solution to a simple equation

1 visualización (últimos 30 días)
RAN
RAN el 17 de Mayo de 2021
Respondida: Stephan el 17 de Mayo de 2021
Hello all,
I am trying to find a solution to a simple problem, the solution exist but I am unable to get it in the correct format
clear all; close all;
syms R L C omega real
eqn=1 - 2*C*L*omega^2 + C^2*R^2*omega^2 + C^2*L^2*omega^4 == 0
R_soln=solve(eqn,R)
I expect a solution for 'R' by moving all the terms to RHS, and in terms of omega, C, L
However I get the following answer
R_soln =
Empty sym: 0-by-1
This has happened many times before, I am trying to understand why solve cannot give me a solution.
  1 comentario
RAN
RAN el 17 de Mayo de 2021
I got the solution to the problem mentioned, but I cant get it in the format I want.
Since I have explicitly defined the variables as real, Matlab tries to find a real solution which does not exist.
The following works:
clear all; close all;
syms R L C omega
eqn=1 - 2*C*L*omega^2 + C^2*R^2*omega^2 + C^2*L^2*omega^4 == 0
R_soln=solve(eqn,R)
However I just want to rearrange the equation to get all the terms ot RHS except for R.
Any idea how to do it?

Iniciar sesión para comentar.

Respuesta aceptada

Stephan
Stephan el 17 de Mayo de 2021
use isolate instead of solve:
clear all; close all;
syms R L C omega
eqn=1 - 2*C*L*omega^2 + C^2*R^2*omega^2 + C^2*L^2*omega^4 == 0
eqn = C^2*L^2*omega^4 + C^2*R^2*omega^2 - 2*C*L*omega^2 + 1 == 0
R_soln=isolate(eqn,R)
R_soln = R == ((C*L*omega^2 - 1)*1i)/(C*omega)

Más respuestas (0)

Categorías

Más información sobre Particle & Nuclear Physics en Help Center y File Exchange.

Etiquetas

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