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;
댓글 수: 0
채택된 답변
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
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) )
figure
fplot(vSol(t),[0 1E-2]); hold on; grid on;
.
댓글 수: 8
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 Center 및 File Exchange에서 Fluid Mechanics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!