Problem with Matlab solver
Show older comments
I have the following expression (transfer function):
H(w) = 0.1/(1 - 0.9exp(-jw))
where w is a symbolic variable (omega).
I'm trying to solve the following expression for w:
|H(w)| == 1/sqrt(2)
Solving this by hand I believe the answer should be 0.105, but I cannot get this answer. I've tried adding assumptions for w is real and w>0
I've tried the following commands:
solve(abs(H)==1/sqrt(2),w)
and
solve(H^2==1/2,w)
With no luck. Any assistance would be greatly appreciated.
Thanks!
Answers (1)
Carlos Felipe Rengifo
on 6 Jul 2018
Hi, You can solve the equation without using symbolic math. The answer can be find in a numerical way:
H = @(w) 0.1/(1 - 0.9*exp(-1i*w));
F = @(w) (abs(H(w))-1/sqrt(2))^2;
Wo = fminbnd(F,0,pi);
As the function H has a period of two times pi, there are infinite solutions: Wo+2*pi, Wo+4*pi, ....
If you really need to use symbolic math, the following sentences give the right solution in Matlab '9.4.0.885841 (R2018a) Update 3'
syms w real;
H = 0.1/(1 - 0.9*exp(-1i*w));
Sol = double(solve(H'*H == 1/2,w));
Sol(Sol < 0) = [];
Categories
Find more on Mathematics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!