solving equations
3 ビュー (過去 30 日間)
古いコメントを表示
I am having difficulty solving an equation with a symbolic variable. If anyone has any suggestions please help!
EDU>> r1=330;
EDU>> r2=1000;
EDU>> c=.47*10^-6;
EDU>> syms f;
EDU>> w=2*pi*f;
EDU>> xc=1/(i*w*c);
EDU>> Vin=1;
EDU>> Vout=(Vin*r2*xc^2)/(1000*r1*(r2+xc)+r2*xc*(xc+1000));
EDU>> solve('abs(Vout)=.707')
ans =
0.707*exp(0.0)
EDU>> solve(abs(Vout)-.707)
Warning: Explicit solution could not be found.
> In solve at 81
ans =
[ empty sym ]
0 件のコメント
回答 (1 件)
Walter Roberson
2011 年 4 月 17 日
I do not have the Symbolic toolbox to test with.
The first form, with the quoted string, is not going to produce the answer you want because at that point the value of Vout has not been transfered from Matlab to the symbolic engine. Try
solve(subs('abs(Vout)=0.707'))
According to a different symbolic package I tried, there are four solutions, all complex:
-((25000/1551)*I)*(-133+(4489+13200*2^(1/2))^(1/2))/Pi
((25000/1551)*I)*(133+(4489+13200*2^(1/2))^(1/2))/Pi
(25000/1551)*(133*I-(-4489+13200*2^(1/2))^(1/2))/Pi
(25000/1551)*(133*I+(-4489+13200*2^(1/2))^(1/2))/Pi
To get these, I substituted 47*10^(-8) for your 0.47*10^(-6) so that the symbolic package would not convert everything to floating point.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!