Fzero function errors in matlab

15 visualizaciones (últimos 30 días)
Ho-Wei LIU
Ho-Wei LIU el 7 de Oct. de 2021
Comentada: Shravan Kumar Vankaramoni el 11 de Oct. de 2021
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 comentario
Shravan Kumar Vankaramoni
Shravan Kumar Vankaramoni el 11 de Oct. de 2021
Can you provide the error message thrown on that line?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Problem-Based Optimization Setup en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by