FSolve - no solution found, last step ineffective
이전 댓글 표시
My function looks like this:
function F=Fn2(t)
global wn a g
F=(wn{1}^2)*a{1}(1,1)*sin(wn{1}*t)+(wn{2}^2)*a{2}(1,1)*sin(wn{2}*t)-g;
end
where wn, a, and g are defined in my main program. I call the function like this:
tlo=fsolve(@Fn2,1)
but fsolve can't seem to find a solution to the equation and is returning: "fsolve stopped because the last step was ineffective. However, the vector of function values is not near zero, as measured by the default value of the function tolerance."
"a" and "wn" are always real, and I've messed around with changing fsolve's x0 position. Any ideas why it's not working? Thanks in advance.
댓글 수: 5
Perhaps there is no solution, for example, as would occur when
g > wn{1}^2*abs(a{1}(1,1)) + wn{2}^2*abs(a{2}(1,1))
Have you tested a case where the solution is known?
Incidentally, global variables are a discouraged method of passing fixed parameters to functions. You should really be doing this:
tlo=fsolve(@(t) Fn2(t,wn,a,g) ,1)
with Fn2 appropriately rewritten to accept (t,wn,a,g) as input arguments. See more info at http://www.mathworks.com/help/optim/ug/passing-extra-parameters.html
Eli
2013년 11월 28일
Matt J
2013년 11월 28일
What are the values of wn,a, and g and what is the corresponding solution t?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!