Fzero function errors in matlab
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Antworten (0)
Siehe auch
Kategorien
Mehr zu Problem-Based Optimization Setup finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!