diff: variable must not be a number; found: | bug??



Solution..below:

On 11/18/2013 10:20 AM, Evan Cooch wrote:
>
> On 11/18/2013 9:57 AM, Leo Butler wrote:
>>       Maxima returns the following error:
>>
>>     diff: variable must not be a number; found: 8
>>
>> Maxima/diff is telling you that when it subst's f1=8 into lls_f1, it
>> finds diff(blah,8), which is non-sensical.
>>
>> You want something like
>>
>> at(lls_f1,[f1=8]);
>>
>>
>
> Thanks!
>
> But why, then, does the following work? And every other bit I've code 
> I've used for a couple of years built on the same approach.
>
> base : 
> matrix([0,0,m_3*s_0,0,0],[(1-sigma_1)*s_1,0,0,0,0],[0,(1-sigma_2)*s_2,s_3,0,0],[sigma_1*s_1,0,0,0,0],[0,sigma_2*s_2,0,s_2,s_3]);
> cp_base : charpoly(base,lambda);
> depends(lambda,sigma_1);
> deriv : diff(cp_base,sigma_1);
> lls_sig1 : solve(deriv,'diff(lambda,sigma_1));
> lls_sigma1 : 
> subst([s_0=0.35,s_1=0.60,s_2=0.80,s_3=0.90,m_3=1.25,lambda=1.08,sigma_1=0,sigma_2=0],lls_sigma1);

Need to add the following:

lls_sigma1 : 
subst([s_0=0.35,s_1=0.60,s_2=0.80,s_3=0.90,m_3=1.25,lambda=1.08,sigma_1=0,sigma_2=0],rhs(first(lls_sigma1));


For some strange reason, I don't always need to do this. But, as soon as 
I add the rhs(first(<whatever I set the implicit deriv to>)), works fine.