Help solving a trignometric equation

Hi There,
I'm trying to simulate the below equation in MATLAB so that I can find Lambda (or the wavelength that is mentioned in each term in the denominator) :-
I used the following code to find it (have attached it as well in case the format is not readable) :- x=10^-9 ; %% 1 nanometer dimension t_si = 10*x ; %% silicon film thickness pi=3.14; t1= (t_si)/2; %% silicon channel t2 = 1*x; %% lower gate oxide thickness t3 = 2*x ;%% upper gate oxide thickness e1 = 11.68 ;%% permitivity of silicon channel e2= 3.9; %% permittibity of lower gate oxide e3= 21; %% permittivity of upper gate oxide (high di-electric) syms lambda; x1=(1/e1) * cot ((pi*t1)/lambda) x2 =(1/e2) * tan((pi*t2)/lambda) x3 = (1/e3) * tan ((pi*t3)/lambda) x4= (e2/(e1*e3))*tan((pi*t2)/lambda)* tan((pi*t3)/lambda) solve(x1-x2-x3-x4 == 0, lambda);
I get the following error (not sure what it means):
Would it be possible to please help me figure out what I'm doing wrong ?? I've used the SolveFunction for simpler equations and it worked out fine,but I can't figure this one out for some reason.
Many Thanks!!!

回答 (3 件)

Mischa Kim
Mischa Kim 2014 年 3 月 4 日

0 投票

Mischa, what MATLAB version are you using? Try
syms lambda real;

5 件のコメント

Mischa Kim
Mischa Kim 2014 年 3 月 4 日
編集済み: Mischa Kim 2014 年 3 月 4 日
...and remove the semi-colon after the solve command
solve(x1-x2-x3-x4 == 0, lambda)
The semi-colon supresses showing results in the MATLAB command window. Alternatively, you could use
lam_sol = solve(x1-x2-x3-x4 == 0, lambda);
which saves the solution for lambda in a variable called lam_sol in the MALTAB workspace.
Please post follow-up questions and comments as comments, not answers.
Mischa
Mischa 2014 年 3 月 4 日
Hi! It works now! (Will have to check manually but thank you!)
Mischa
Mischa 2014 年 3 月 4 日
編集済み: Mischa 2014 年 3 月 4 日
</matlabcentral/answers/uploaded_files/9004/wewewew.PNG> got this error now and it worked before :/
Mischa
Mischa 2014 年 3 月 4 日
Undefined function 'syms' for input arguments of type 'char'.
I have no idea why the above error is coming up now
Mischa Kim
Mischa Kim 2014 年 3 月 4 日
編集済み: Mischa Kim 2014 年 3 月 4 日
I am speculating here but I think you have saved your code as a script named solve.m. If so, save it under a different name. solve() is a MATLAB function, one you are using in the script. Just to make the code is working correctly you could copy-paste it into the MATLAB command window and execute it.

サインインしてコメントする。

Mischa
Mischa 2014 年 3 月 4 日

0 投票

Matlab R2013a
I did that and instead of the error,I'm not getting any output :/ Here's a screenshot
Mischa
Mischa 2014 年 3 月 4 日

0 投票

Hi! It works now! (Will have to check manually but thank you!)

質問済み:

2014 年 3 月 4 日

編集済み:

2014 年 3 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by