How to use a solver to get the terminal velocity of a sphere.

32 次查看(过去 30 天)
Hello Everyone,
I need to know the Terminal Velocity of a sphere falling down in an airstream.
The Problem is, that to find die Drag Coefficient for the Sphere you need to know the Reynoldsnumber. And the Reynoldsnumber is dependable on the velocity of the sphere. I already calculated a solution by hand by guessing some inital values to iterate to the correct Reynoldsnumber. But now i want to use a equation that correlates the Drag Coefficient to the Reynoldsnumber and then use a solver which numerically finds the terminal velocity.
Those are the eqations i want to use:
Can i solve this with the fsolve function?
Best regards!

采纳的回答

Torsten
Torsten 2024-10-29,11:27
v0 = fsolve(@fun,1)
function res = fun(v0)
d_p =...;
rho_air = ...;
nu_air = ...;
rho_w = ...;
g = ...;
Re = d_p*v0*rho_air/nu_air;
Cd = 24/Re*(1+(Re^(2/3))/6);
res = v0^2-4*d_p*(rho_w-rho_air)*g/(3*Cd*rho_air);
end
  2 个评论
Niklas Humberg
Niklas Humberg 2024-10-29,14:31
Thanks a lot! Is it somehow possible to declare the parameters outside of the function? I need to plott different results against different parameters
Torsten
Torsten 2024-10-29,18:14
d_p =...;
rho_air = ...;
nu_air = ...;
rho_w = ...;
g = ...;
v0 = fsolve(@(v0)fun(v0,d_p,rho_air,nu_air,rho_w,g),1)
function res = fun(v0,d_p,rho_air,nu_air,rho_w,g))
Re = d_p*v0*rho_air/nu_air;
Cd = 24/Re*(1+(Re^(2/3))/6);
res = v0^2-4*d_p*(rho_w-rho_air)*g/(3*Cd*rho_air);
end

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by