How can i make my ODE graph make sense?

1 次查看(过去 30 天)
I don't know why my graph is like that ! I tried to plot the differential and the solved ODE but my graph dont make sense.
I'm trying to make a graph of a ODE about a ball dropping in oil, the values are all random, just to plot the thing
clear; clc;
clearvars;
syms t v(t) aa g p p1
aa = 5;
u = 3;
g = 10
p1 = 9;
p = 3;
v0= 0;
cond = v(0) == v0
eqn = diff(v,t) == (1-p1/p)*g-(9*u/2*aa^2*p)*v
vSol(t)= simplify( dsolve(eqn,cond) )
fplot(t,vSol(t),[0 10000]); hold on; grid on;

采纳的回答

Star Strider
Star Strider 2021-10-18
The fplot call is incorrect, and the function declines so quickly that it’s not possible to see it clearly with a time interval going from 0 to 1E+5.
Correct those and it works!
syms t v(t) aa g p p1
aa = 5;
u = 3;
g = 10
g = 10
p1 = 9;
p = 3;
v0= 0;
cond = v(0) == v0
cond = 
eqn = diff(v,t) == (1-p1/p)*g-(9*u/2*aa^2*p)*v
eqn(t) = 
vSol(t)= simplify( dsolve(eqn,cond) )
vSol(t) = 
figure
fplot(vSol(t),[0 1E-2]); hold on; grid on;
.
  8 个评论
Ian Samuelsson
Ian Samuelsson 2021-10-18
is a ODE :
[A body falling in a relatively dense fluid, oil for example, is acted on by three forces (see Figure 2.3.5): a resistive force R, a buoyant force B, and its weight w due to gravity. The buoyant force is equal to the weight of the fluid displaced by the object. For a slowly moving spherical body of radius a, the resistive force is given by Stokes’s law, R = 6πµa|v|, where v is the velocity of the body, and µ is the coefficient of viscosity of the surrounding fluid...]
i finish everything, i'm just suferying in the graphs ahahahah.
@Star Strider About the disable is just turn off the hold ? putting hold off ? i did not understand that part.
Star Strider
Star Strider 2021-10-18
The hold condition can be toggled on or off depending on whether other data are to be plotted to the same axes, or not.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fluid Mechanics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by