a newbe question ---- divide



Stavros Macrakis wrote:

>> a:(s3+B*s2+C*s+d)/(s+a);
>
>> I would like to do this division and get the quadratic and the remainder
>> both out as a formula to use later.
>> How do I do this?
>
> Is this what you have in mind?
>
> (%i1) expr:(s^3+B*s^2+C*s+d)/(s+a);
>
>                      3      2
>                     s  + B s  + C s + d
> (%o1)               -------------------
>                            s + a
>
> (%i2) divide(part(expr,1),part(expr, 2));



Yes.

Now I have another question.
this is my batch file  pidmath.mac

kill(all);
pid:(KD*s^2+KP*s+KI)/s;
plant:64/(s^2+12*s+32);
cl:pid*plant/(1+pid*plant);
careq1:denom(cl),ratsimp;
careq:careq1=0;
q1:divide(careq1,(s+a));
quadr1:part(q1,1);
rem:part(q1,2);

/* now set a=(real part of complex roots)  */

a1:part(quadr1,2)/(2*s),ratsimp;
a2:a1=a;
a3:solve(a2,a);
/* now set up the settling time*/
Ts:1;
Ts1:5/a1=Ts,ratsimp;

rr:solve([a2,Ts1],[KD , a]);
rr1:rr[1];
KD1:rr1[1];
aa1:rr1[2];
eq3:(part(quadr1,3)^2)*2/sqrt(2)=part(quadr1,2)/s,ratsimp;
solve([eq3,KD1,aa1],[KP]);


So far I have all the correct answers but the last line does not work????
why can't it solve these 3 equations for KP?

My goal is the have Maxima show all the steps that are in the text book 
that I am teaching from.
There are about 3 more steps to go.

Doug Stewart