matlab 符号等式化简问题

>> syms M m g u Fn th
tan(th)=M*(m*g+u*Fn*sin(th)-Fn*cos(th))/((M-m)*Fn*sin(th)+u*Fn*cos(th));simple(Fn)

simplify:

Fn

radsimp:

Fn

simplify(Steps = 100):

Fn

combine(sincos):

Fn

combine(sinhcosh):

Fn

combine(ln):

Fn

factor:

Fn

expand:

Fn

combine:

Fn

rewrite(exp):

Fn

rewrite(sincos):

Fn

rewrite(sinhcosh):

Fn

rewrite(tan):

Fn

mwcos2sin:

Fn

collect(Fn):

Fn

ans =

Fn

我想把Fn用其他符号表示出来,为什么不能实现呢?哪里出问题了?

还有
>> syms f=Fn*u
Error using syms>getnames (line 95)
Not a valid variable name.
Error in syms (line 59)
[vars,funs,control] = getnames(varargin);
我想实现用f代替u*Fn这个怎么处理呢?

第1个回答  2013-11-17
>>syms M m g u Fn th
>> Fn=solve('tan(th)=M*(m*g+u*Fn*sin(th)-Fn*cos(th))/((M-m)*Fn*sin(th)+u*Fn*cos(th))','Fn')
Fn =
-M*m*g/(-tan(th)*sin(th)*M+tan(th)*sin(th)*m-tan(th)*u*cos(th)+M*u*sin(th)-M*cos(th))
>>Fn=simplify(Fn)
Fn=
-M*m*g*cos(th)/(-sin(th)*u*cos(th)+M*u*sin(th)*cos(th)-cos(th)^2*m+m-M)
>> Fn=simple(Fn)
Fn =
-M*m*g*cos(th)/(-sin(th)*u*cos(th)+M*u*sin(th)*cos(th)-cos(th)^2*m+m-M)
>> syms u
>> f=Fn*u
f =
-M*m*g*cos(th)/(-sin(th)*u*cos(th)+M*u*sin(th)*cos(th)-cos(th)^2*m+m-M)*u追问

我引入f是为了简化输入,让方程看起来不那么臃肿。。。不是求f表达式。这个怎么实现呢?

还有,化简这个还有别的函数可以实现吗?必须用solve? 谢谢

追答

是的,只有用solve解出Fn后才能化简。

追问

为了简化输入,让方程看起来不那么臃肿。。。用f代替u*Fn这个怎么实现呢? 谢谢

追答

已经得到f的表达式,可以在别处使用。

追问

我意思是在输入tan(th)表达式的时候就用f代替u*Fn,仅仅是为了简化输入,不是求f的表达式。你明白我的意思?

相似回答