Fzero function errors in matlab

조회 수: 14 (최근 30일)
Ho-Wei LIU
Ho-Wei LIU 2021년 10월 7일
댓글: Shravan Kumar Vankaramoni 2021년 10월 11일
xN = zeros(1,Niter); % dispalcemant analytical
dxN = zeros(1,Niter); % dispalcemant_dot analytical
ddxN = zeros(1,Niter); % dispalcemant_double_dot analytical
xN(1) = x0; % initial displacement
xN(2) = x0 + v0*dt; % displacement at iteration 2
dxN(1) = v0; %initial vel
dxN(2) = v0;
Const_drag = 0.5*Cd*p*A;
Const_lift = 0.5*Cl*p*A;
for i = 3:Niter
xNOW = xN(i-1);
xPRE = xN(i-2);
f = @(xNEX) ...
m * (xNEX - 2*xNOW + xPRE)/(dt^2)...
+ 0.5 * Const_drag * ((xNEX-xPRE)/(2 * dt))...
+ (-0.0001 * (w + Const_lift * ((xNEX-xPRE)/(2 * dt))^2)^2)...
+ 1.6 * (w + Const_lift * ((xNEX-xPRE)/(2 * dt)) ^ 2);
xNEX = fzero(f, xNOW);
xN(i) = xNEX;
dxN(i) = (xNEX - xPRE)/(2*dt);
end
% xNEX = fzero(f, xNOW); this line keep showing errors but i could not figure out
  댓글 수: 1
Shravan Kumar Vankaramoni
Shravan Kumar Vankaramoni 2021년 10월 11일
Can you provide the error message thrown on that line?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by