- a=0.5;b=33.5;y0=0.005;v0=0.04;
- %syms a b y0 v0
- syms t x y
- w=sqrt(b+y);
- e=(a+x)*0.5/w;
- wd=w*sqrt(1-e^2);
- d0=sqrt(y0^2+((v0+e*w*y0)/wd)^2);
- s=simple(d0*exp(-e*w*t)*sin(wd*t+atan(y0*wd/(v0+e*w*y0))));
- ds=simple(diff(s,t));
- u=simple(x*ds+y*s);
- du=simple(diff(u,t));
- tu=solve(du,t);
- u1=simple(subs(u,t,tu));
- ezmesh(u1,[0,15]);
复制代码
运行后,Warning: Divide by zero.ezmesh自定义了定义域应该不会出现分母为0的点?
把a,b,y0,v0(均大于0)当作符号时,u1函数的定义域应该满足
-4*b-4*y+a^2+2*a*x+x^2<0,即在平面上是一个向上的抛物线的内部,
用[ x,y]=meshgrid(0:0.5:15,0:0.5,15),mesh画u1时,表示定义域是一个矩形区域,超出了函数定义域范围,运行时出现“x,y,z can not be complex” |