Solution to a simple equation

1 回表示 (過去 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 件)

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by