Finding a particular solution when there are infinitely many
이전 댓글 표시
I need to find a particular solution for a specific range.
The solution I got using the solve method led me to a 0.
>> a1 = 5;
>> a2 = 10;
>> b = 13;
>> c = 1*10^-3;
>> d = 0.57 * 10^-3;
>> e = 0.57 * 10^-3;
>> d1 = d/c;
>> e1 = e/c;
>> f = 0.02 * 10^-3;
>> g = d/c+e/c-1;
>> h = acos(1 - f/(2*g*c));
>> n = 6*(10^6)*g^2+3*(10^6)*g*6894.75729;
>> syms m;
k = @(a,m) a ./ (b .* ((c)^2)*n) - sin(m) .* ((cos (h) ./ cos (m))-1).^1.5;
solve(m);
>> solve(m)
ans =
0
However, the range of values where my solution lies is 0.35< m < 0.41 as shown in the photo. which isn't 0. http://i.imgur.com/RrMO1Ro.jpg
Previous related question I asked which was solved for some history. http://www.mathworks.com/matlabcentral/answers/64353-error-using-char-how-do-i-solve-a-transcendental-equation-for-given-variables
댓글 수: 2
Ikhsan
2013년 3월 1일
Juan Camilo Medina
2013년 3월 1일
편집: Juan Camilo Medina
2013년 3월 5일
Matlab cannot plot func2 because you haven't define a, in other word, you are trying to do a 2D plot of a multivarible equation without the necessary input arguments.
You need to define what a is, let's say you picked a to be 5 then try:
m = - 4:0.01:4; plot(m,func2(5,m))
답변 (2개)
Walter Roberson
2013년 3월 1일
0 개 추천
Do not apply solve() to a function handle. Apply fsolve() to function handles, or apply solve() to symbolic expressions.
댓글 수: 5
Ikhsan
2013년 3월 1일
Walter Roberson
2013년 3월 1일
You should have used @func2 not @myfun
Ikhsan
2013년 3월 2일
Walter Roberson
2013년 3월 5일
Which MATLAB version are you using?
Ikhsan
2013년 3월 6일
Juan Camilo Medina
2013년 3월 1일
your syntax is wrong, instead of using
solve(m)
try
syms m a;
k = @(a,m)a./(b.*((c)^2)*n)-sin(m).*((cos(h)./cos(m))-1).^1.5;
solve(k(a,m)==0,m)
But it also appears that your equation is ill-posed. If you look at the picture you posted, they are plotting E vs. a, and not m. It's rather strange that an equation with a bunch of sines and cosines gives you a straight line.
댓글 수: 3
Ikhsan
2013년 3월 2일
Juan Camilo Medina
2013년 3월 5일
I think your problem is not how you solve it, but your equation instead. It seems to be ill-posed. Check your problem statement.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!