matlab题:可以怎么改?
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/15 16:14:00
matlab题:可以怎么改?
一个质量为75kg的人在某一高度静止下落,空气阻力F与v的关系满足F=-k ,其中常数k=0.22kg/m,根据牛顿第二定律知,若令g=9.80m/ ,求下落过程中速度v(t)和位移x(t)的表达式,并画图.
>> clear
>> syms t v x
>> v=dsolve('Dv=g-k*v^2/m','v(0)=0');
>> x=int(v);
>> m=75;
>> g=9.8;
>> k=0.22;
>> t=0:0.5:30;
>> v=subs(v);
Error using ==> sym.subs
Elements of the substitution cell array must be of the same size.
>>x=subs(x);
Error using ==> sym.subs
Elements of the substitution cell array must be of the same size.
>> plot(t,v)
Error using ==> plot
Conversion to double from sym is not possible.
>> plot(t,x)
Error using ==> plot
Conversion to double from sym is not possible.
一个质量为75kg的人在某一高度静止下落,空气阻力F与v的关系满足F=-k ,其中常数k=0.22kg/m,根据牛顿第二定律知,若令g=9.80m/ ,求下落过程中速度v(t)和位移x(t)的表达式,并画图.
>> clear
>> syms t v x
>> v=dsolve('Dv=g-k*v^2/m','v(0)=0');
>> x=int(v);
>> m=75;
>> g=9.8;
>> k=0.22;
>> t=0:0.5:30;
>> v=subs(v);
Error using ==> sym.subs
Elements of the substitution cell array must be of the same size.
>>x=subs(x);
Error using ==> sym.subs
Elements of the substitution cell array must be of the same size.
>> plot(t,v)
Error using ==> plot
Conversion to double from sym is not possible.
>> plot(t,x)
Error using ==> plot
Conversion to double from sym is not possible.
clearv=dsolve('Dv=g-k*v^2/m','v(0)=0');
x=int(v);
m=75;
g=9.8;
k=0.22;
T=0:0.5:30;
for i=1:61
t=(i-1)/2;
V(i)=subs(v);
end
plot(T,V)
x=int(v);
m=75;
g=9.8;
k=0.22;
T=0:0.5:30;
for i=1:61
t=(i-1)/2;
V(i)=subs(v);
end
plot(T,V)