matlab 求解带参数的方程,目的是用c表示x,y,求大神指导……代码如下
matlab 求解带参数的方程,目的是用c表示x,y,求大神指导……代码如下
>> syms x y a b c d;
>> d=7.2^2+8^2;
>> a=c/14.4;
>> b=atan(8/7.2);
>> b=atan(8/7.2);
>> [x,y]=solve('y=tan(a+b)*x','x^2+y^2=d','c')
Warning:2 equations in 1 variables.
> In E:\Matlab\toolbox\symbolic\symbolic\symengine.p>symengine at 54
In mupadengine.mupadengine>mupadengine.evalin at 96
In mupadengine.mupadengine>mupadengine.feval at 137
In solve at 151
Warning:Explicit solution could not be found.
> In solve at 160
x =
[ empty sym ]
y =
[]
>>
最后一句改成[x,y]=solve('y=tan(a+b)*x','x^2+y^2=d','d,b');能求了,不过求出的x,y表达式里仍含有x,y.
x =atan(y/x) - a
y =x^2 + y^2
不知道是不是matlab求不出解析解来!用mathematica或者maple吧!谢谢你的回答,还是解不出来啊……>> syms x y c>> [x,y]=solve('y-tan(c/14.4+atan(8/7.2))*x=0','x^2+y^2-7.2^2-8^2=0','c')x =[ empty sym ]y = []>>help solve里有这么一句话, S = solve('a*u^2 + v^2','u - v = 1','a,u') regards 'v' as a parameter, solves the two equations, and returns S.a and S.u.也就是说最后一个引号里的不是参数,没在引号里那个才是参数。所以你程序第二行直接改成>> [x,y]=solve('y-tan(c/14.4+atan(8/7.2))*x=0','x^2+y^2-7.2^2-8^2=0)就行了。不会了,多看看help 帮助文档谢谢啦,问题解决了,但是"没在引号里的"指的是那一部分??help solve下solve有三中调用格式 SOLVE('eqn1','eqn2',...,'eqnN')SOLVE('eqn1','eqn2',...,'eqnN','var1,var2,...,varN')SOLVE('eqn1','eqn2',...,'eqnN','var1','var2',...'varN')最后一个引号里的那一串东西,不是参数,是变量。S = solve('a*u^2 + v^2','u - v = 1','a,u')求的是变量a,u关于参数v的解