How to solve a complex-valued equation
이전 댓글 표시
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
madhan ravi
2018년 12월 2일
upload the values to test
Ajay Gupta
2018년 12월 2일
Bruno Luong
2018년 12월 2일
"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
2018년 12월 2일
채택된 답변
추가 답변 (1개)
Stephan
2018년 12월 2일
1 개 추천
Hi,
Best regards
Stephan
카테고리
도움말 센터 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!