diff: variable must not be a number; found: | bug??
Subject: diff: variable must not be a number; found: | bug??
From: Robert Dodier
Date: Mon, 18 Nov 2013 17:48:59 +0000 (UTC)
On 2013-11-18, Evan Cooch <evan.cooch at gmail.com> wrote:
> 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.
Well, 'subst' doesn't pay attention to the special role of the variables
in a derivative, which leads to the "can't differentiate wrt a number"
message. 'at' is just like subst except that it treats variables in a
derivative differently (also, iirc, integrals & summations). For those,
it yields a noun expression.
If you omit the rhs(first(lls_sigma1)) you get something like the
following from 'at':
['at('diff(...., sigma_1), [sigma_1=..., ...]) = <some number>]
best
Robert Dodier