马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
>> sym [A B C D E x0 h];
>> [A B C D E]=solve('A+B+C+D+E=0','A*(x0-2*h)+B*(x0-h)+C*x0+D*(x0+h)+E*(x0+2*h)=0','A*(x0-2*h)^2+B*(x0-h)^2+C*x0^2+D*(x0+h)^2+E*(x0-2*h)^2=2','A*(x0-2*h)^3+B*(x0-h)^3+C*x0^3+D*(x0+h)^3+E*(x0+2*h)^3=6*x0','A*(x0-2*h)^4+B*(x0-h)^4+C*x0^4+D*(x0-h)^4+E*(x0+2*h)^4=12*x0^2','A','B','C','D','E')
??? Error using ==> mupadengine.mupadengine>mupadengine.feval at 156
Error: illegal unknown [numeric::fsolve]
Error in ==> solve at 157
R = feval(symengine,'mlfsolve',eqns,vars);
把x0删掉··可以运行···
[A B C D E]=solve('A+B+C+D+E=0','A*(-2*h)+B*(-h)+C*0+D*(h)+E*(2*h)=0','A*(-2*h)^2+B*(-h)^2+C*0^2+D*(h)^2+E*(2*h)^2=2','A*(-2*h)^3+B*(-h)^3+C*0^3+D*(h)^3+E*(2*h)^3=0','A*(-2*h)^4+B*(-h)^4+C*0^4+D*(h)^4+E*(2*h)^4=0^2','A','B','C','D','E')
Warning: Explicit solution could not be found.
> In solve at 170
ANS:
A =[ empty sym ]
B = []
C = []
D = []
E = []
但在只有A、B、C、x0的时候可是完全正常的··
>> [A B C]=solve('A+B+C=0','A*(x0-h)+B*x0+C*(x0+h)=1','A*(x0-h)^2+B*x0^2+C*(x0+h)^2=2','A','B','C')
ANS:
A =-(h + 2*x0 - 2)/(2*h^2)
B =(2*x0 - 2)/h^2
C =(h - 2*x0 + 2)/(2*h^2)
>> [A B C]=solve('A+B+C=0','A*(x0-h)+B*x0+C*(x0+h)=0','A*(x0-h)^2+B*x0^2+C*(x0+h)^2=2','A','B','C')
ANS:
A =1/h^2
B =-2/h^2
C =1/h^2
[ 本帖最后由 ChaChing 于 2009-4-7 07:57 编辑 ] |