怎么用MATLAB求解隐性函数方程

来源:百度知道 编辑:UC知道 时间:2024/07/07 21:01:25
有一个很简单的方程我用MATLAB解不出,如下:
q=0;
s=('70*cos(q)+130*(1-(90*sin(p)-70*sin(q))/130)^0.5-90*cos(p)=150');
p=solve('s')

我想解是"P"值,最后得出的系空值,是不是最后一步的问题?
q=0;
s=('70*cos(q)+130*(1-(90*sin(p)-70*sin(q))/130)^0.5-90*cos(p)=150');
>> p=solve(s)
Quit:
??? Error using ==> maple
at offset 7, `]` unexpected

Error in ==> D:\应用程序\MATLAB1\toolbox\symbolic\@sym\findsym.m
On line 53 ==> v = maple(['sort(',v,',lexorder)']);

Error in ==> D:\应用程序\MATLAB1\toolbox\symbolic\solve.m
On line 97 ==> vars = ['[' findsym(sym(eqns),neqns) ']'];

按你们俩个说的再试了一遍,出现以上两种错误,还是不行,高手快出现啊~~~~~~~~~~~~~~~~

solve是解解析解的,如果没有解析解,就返回空值。
没有解析解,可用fsolve解数值解。
另外用solve时,定义全要符号变量:
syms p q s
s=70*cos(q)+130*(1-(90*sin(p)-70*sin(q))/130)^0.5-90*cos(p)=150
subs(s,q,0) % 把q换成0
ans =
130*(1 - (9*sin(p))/13)^(1/2) - 90*cos(p) - 80
>> solve(ans)
ans =

2*atan(39/112 - ((7439*(9*((13*2^(1/2)*3^(1/2)*649357^(1/2))/10976 + 175451/84672)^(2/3) - (27975*((13*2^(1/2)*3^(1/2)*649357^(1/2))/10976 + 175451/84672)^(1/3))/3136 - 7439/784)^(1/2))/784 - 9*((13*2^(1/2)*3^(1/2)*649357^(1/2))/10976 + 175451/84672)^(2/3)*(9*((13*2^(1/2)*3^(1/2)*649357^(1/2))/10976 + 175451/84672)^(2/3) - (27975*((13*2^(1/2)*3^(1/2)*649357^(1/2))/10976 + 175451/84672)^(1/3))/3136 - 7439/784)^(1/2) - (27975*((13*2^(1/2)*3^(1/2)*649357^(1/2))/10976 + 175451/84672)^(1/3)*(9*((13*2^(1/2)*3^(1/2)*649357^(1/2))/10976 + 175451/84672)^(2/3) - (27975*((13*2^(1/2)*3^(1/2)*649357^(1/2))/10976 + 175451/84672)^(1/3))/3136 - 7439/784)^(1/2))/1568 - (99333*6^(1/2)*((351*2^(1/2)*3^(1/