finding roots of the equation
2 次查看(过去 30 天)
显示 更早的评论
For several value of n (n=1,2,3,4,...), it was needed to find roots of under equation.
f(n,I)=n*210+(I^2/n)*[(((200-32I)^2)/200)+32]-197
Please help me, how can I find answer by using MATLAB. And please give me answers (value of I) for n=1,2,3,4,5
0 个评论
采纳的回答
Matt Tearle
2012-2-10
You may want to check your function, because it doesn't seem to have any (real) zeros:
f = @(n,I) n*210+(I.^2/n).*((((200-32*I).^2)/200)+32)-197;
figure
I = linspace(-100,100,5001);
y = f(1,I);
plot(I,y)
min(y)
But, the approach would be to define a function handle for f, as above, then set the value of n and apply fzero to the resulting function of one variable ( I ):
f = @(n,I) n*210+(I.^2/n).*((((200-32*I).^2)/200)+32)-197;
I0 = 0; % Make an initial guess
for n = 1:5
g = @(I) f(n,I); % Make a new function from f(n,I) with n fixed
I0 = fzero(g,I0) % Find zero, starting with previous result
end
2 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!