Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to calculate the partial derivative?
Replies: 6   Last Post: Nov 21, 2012 5:17 AM

 Messages: [ Previous | Next ] Topics: [ Previous | Next ]
 Nasser Abbasi Posts: 6,677 Registered: 2/7/05
Re: How to calculate the partial derivative?
Posted: Nov 21, 2012 5:17 AM

On 11/21/2012 3:08 AM, Tang Laoya wrote:

> Howerver, I still didn't understand your code, could you give me some more
>

The reason it does not work as is in your second example, is
because this is a typical sub-expression finding and replacement
issues in all CAS systems.

The expression you want to replace is there, but it is now build into
the over all more complex expression you have
(not like the simpler example you had before, where the
expression we wanted to replace was there as is)

Hence, one needs to do more work to extract these expressions out
and replace them back with your L1 and L2 using pattern rules.

For example, looking at part of one of your expressions below

>
> DNx = D[NN, x];
> DNx = DNx /. {rhs[eq1] -> lhs[eq1], rhs[eq2] -> lhs[eq2],
> rhs[eq3] -> lhs[eq3], rhs[eq4] -> lhs[eq4]}
>

b1*(a1 + b1*x + c1*y + d1*z))/(18*
V^2) + (b1*(-1 + (a1 + b1*x + c1*y + d1*z)/(3*V)))/(6*V)

and we want now to replace the following subexpressions
(a1 + b1*x + c1*y + d1*z)/6/V
and
(a2 + b2 x + c2 y + d2 z)/6/V

with L1 and L2. So you see there is /18*V^2 in the denominator
while the expression we want to replace has /6*V. So a factoring
out is needed or such operation.

Since we are using pattern matching replacement, Mathematica
is looking for the exact pattern and it can't find it.

So, one needs to do more work on the final expression
to be able to find those patterns you want to replace with
L1 and L2. May be a combination of Simplify/Factor/Collect etc..

If I see an easy way to do this, will post an answer. But I am
not an expert in this subject, so may be there is a better approach
to this whole issue that avoids these problem from first place.

good luck!

--Nasser

Date Subject Author
11/21/12 Tang Laoya
11/21/12 Nasser Abbasi
11/21/12 Tang Laoya
11/21/12 Nasser Abbasi
11/21/12 Tang Laoya
11/21/12 Tang Laoya
11/21/12 Nasser Abbasi