optimization - maxima: optimize does not optimize away many repeated expressions -
my code below. problem many repeated expressions not eliminated optimize. clue? inserted subst because without them result worse.
debugmode(true)$ exptsubst:true$ display2d:false$ id1(v):=is1*(exp(v/n1vt)-1.0)$ id2(v):=is2*(exp(v/n2vt)-1.0)$ f(v):=id1(v)+id2(v)+gmin*v-i$ d:3$ v + d*diff(1/f(v), v, d - 1)/diff(1/f(v), v, d)$ subst(exp1, exp(v/n1vt), %)$ subst(exp2, exp(v/n2vt), %)$ facsum(%, v)$ optimize(%)$ %;
Comments
Post a Comment