Solution to a simple equation

조회 수: 3(최근 30일)
RAN
RAN 2021년 5월 17일
답변: Stephan 2021년 5월 17일
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
RAN
RAN 2021년 5월 17일
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?

댓글을 달려면 로그인하십시오.

채택된 답변

Stephan
Stephan 2021년 5월 17일
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)

추가 답변(0개)

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by