How to solve a complex-valued equation
Show older comments
I'm trying to use fzero, but it seems that it can't handle solving for a variable that's complex. Here's my code:
E = 169e9; % Young's Modulus of Silicon [N/m^2] (Assuming one that's isotropic)
W = 2e-6; % Width of Cantilever Beam [m]
H = 2e-6; % Height of Cantilever Beam [m]
L = 5e-6; % Length of Cantilever Beam [m]
V_dc = 5; % DC Voltage [V]
V_ac = 2; % AC Voltage Magnitude [V]
omega = [80e6, .01e6, 110e6]; % Angular Frequency of AC Voltage [rad/s]
g = 5e-6; % Initial Gap between Cantilever Beam and Substrate/Switch Terminal [m]
A = W * H; % Overlap Area between Cantilever Beam and Electrodes [m^2]
e_0 = 8.854e-12; % Permittivity of Free Space [F/m]
k = (E * W * H ^ 3) / (4 * L ^ 3); % Spring Constant of Cantilever Beam [N/m]
% Setting dU/dx equal to kx, and solving for x
for k1 = 1:length(omega)
omega_val = omega(k1);
f = @(x) (1 / 2) * 1i * omega_val * ((e_0 * A) / (g - x) ^ 2) * (V_dc + V_ac) ^ 2 - k * x; % Setting up equation to solve
x(k1) = fzero(f, 0);
end
Basically, omega is a vector of some length with real values, and all the other variables are real as well. But since the imaginary number is present in the equation, the value for x that I'm looking for should be imaginary as well. How would I go about doing this? Thanks in advance.
4 Comments
madhan ravi
on 2 Dec 2018
upload the values to test
Ajay Gupta
on 2 Dec 2018
Bruno Luong
on 2 Dec 2018
"But since the imaginary number is present in the equation, the value for x that I'm looking for should be imaginary as well. "
Not really, you barely multiply your entire relevant expression by 1/2*1i.
If you solve f(x) = 0, it does not change anything fundamental after multiplying the equation by constant that is not equal to 0, where as it's complex, imaginary or real.
Secondly
((e_0 * A) / (g - x) ^ 2)
never vanishes unless |x| = infinity
Ajay Gupta
on 2 Dec 2018
Accepted Answer
More Answers (1)
Stephan
on 2 Dec 2018
1 vote
Hi,
Best regards
Stephan
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!