The solve function in MATLAB is mainly used to solve the analytic solution or exact solution of the linear equation Group. For the resulting result is a symbolic variable, the numerical solution of any number of digits can be obtained by VPA ().
There are four main syntax definitions for the solve function:
Solve (eq)
Solve (EQ, var)
Solve (eq1, EQ2, ..., eqn)
g = Solve (eq1, EQ2, ..., eqn, var1, Var2, ..., Varn)
EQ represents the equation, var stands for the variable.
But in my use, solve can not help me solve the problem:
My purpose: Known control object G0 and expected cut-off frequency WC, the frequency at any amplitude
This was used at the outset:
Wc=solve (' 20*log10 (ABS (G0 (WC)) =10*log10 (3) ', ' WC '),%g0 (WC) is a specific transfer of WC, 10*LOG10 (3) is a specific amplitude
The result of debugging is that the WC is an empty matrix, suggesting that the equation (20*log10 (G0 (WC)) =10*LOG10 (3)) is invalid. Then add this in front: sym WC;
It's still not working.
Then use this method:
For w=0.1:0.1:20
L=20*LOG10 (ABS (wn^2/((w*i) * ((I*W) ^2+2*zeta*w*wn*i+6^2)));
If l== (10*LOG10 (3)-0.001)
Wc=w;
End
End
L is the specific letter of communication. When debugging or not, WC is still empty. found that the IF SELECT statement is not running at all.
is not the precision of the W is small, cannot make if the condition (L==10*LOG10 (3)) satisfies.
Then I changed the W precision to 0.01,0.001.
Then I think it is not such accuracy can not meet the conditions, so I changed the conditions: l>= (10*LOG10 (3) -0.001) &&l<= (10*LOG10 (3) +0.001)
The end is still not ...
One more question: I tested ABS (), the modulo value function and the solve () function, and found that if it was solving the real number equation, OK, there was no problem; but if the complex equation is not:
>> Clear
>> syms x y
>> [X,y]=solve (' x^2+y^2=1 ', ' x ', ' y ')
x =
-(1-z^2) ^ (1)
-z^2) ^ (a)
y =
Z
z
>> Clear
>> syms x y
>> [X,y]=solve (' abs (x*i+y^2) =1 ', ' x ', ' y ')
x =
-exp (2*u*i) *i + Z^2*i
y =
Z
What is this for?