已知各参数的关系,求p最终的表达式,里面没有u2 感觉好像结果是错的,大家看看这个对吗
代码内容
clear all;
clc;
syms a b B ct cs u1 u2 w g k
p1 = ((1-w*u1)*(a+B*g-b*ct)+cs*(b*w*u2+b+b*w*(1-u1-u2)))/(2*(1-w*u1)*(b*w*u2+b+b*w*(1-u1-u2)));
p2 = (a+B*g-b*p1*w*u2+b*p1+b*ct+b*p1*w*(1-u1-u2))/(2*b);
p = (a+b*p2+b*p1*w*u2+B*g)/(2*b);
q = a-b*p+B*g ;
pi1 = q*(p1-cs-p1*w*u1)-(1/2)*k*g^2;
pi2 = q*(p2-p1-ct-p1*w*(1-u1-u2))-(1/2)*k*g^2;
pi = q*(p-p2-p1*w*u2);
f = diff(pi2,u1);
simple_p = simplify(p);
pretty(simple_p)
运行结果及报错内容
- 1*(7 a + 7 B g + b cs + b ct + b cs w - 7 a u1 w - b cs u1 w - b ct u1 w - 7 B g u1 w)/ 8 b (u1 w - 1)