现有两个符号等式,怎样用matlab求出p1和pn啊...求大神给出程序!(等式在追问里面)
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/14 05:58:34
现有两个符号等式,怎样用matlab求出p1和pn啊...求大神给出程序!(等式在追问里面)
1-2*p1+c+(pn-c)*(y*k-y*q)/k*q/(k-q)=0和t*(k-q-pn+(t*pn-y*k+y*q+y*p1*k-y*p1*q)/t/k*q)/(k-q)+(pn-c)*t*(-1+1/k*q)/(k-q)=0
1-2*p1+c+(pn-c)*(y*k-y*q)/k*q/(k-q)=0和t*(k-q-pn+(t*pn-y*k+y*q+y*p1*k-y*p1*q)/t/k*q)/(k-q)+(pn-c)*t*(-1+1/k*q)/(k-q)=0
ep1 = '1-2*p1+c+(pn-c)*(y*k-y*q)/k*q/(k-q)=0';
ep2 = 't*(k-q-pn+(t*pn-y*k+y*q+y*p1*k-y*p1*q)/t/k*q)/(k-q)+(pn-c)*t*(-1+1/k*q)/(k-q)=0';
[p1,p2] = solve(ep1,ep2)
p1 =
-k*(-2*p1^2-1+3*p1-c+p1*c)/(-pn*k+c*k+2*pn^2-3*pn*c+c^2)
p2 =
k*(1-2*p1+c)/q/(-pn+c)
ep2 = 't*(k-q-pn+(t*pn-y*k+y*q+y*p1*k-y*p1*q)/t/k*q)/(k-q)+(pn-c)*t*(-1+1/k*q)/(k-q)=0';
[p1,p2] = solve(ep1,ep2)
p1 =
-k*(-2*p1^2-1+3*p1-c+p1*c)/(-pn*k+c*k+2*pn^2-3*pn*c+c^2)
p2 =
k*(1-2*p1+c)/q/(-pn+c)