Re: quadratic multiplication
- To: mathgroup at smc.vnet.net
- Subject: [mg84333] Re: quadratic multiplication
- From: dh <dh at metrohm.ch>
- Date: Wed, 19 Dec 2007 04:18:06 -0500 (EST)
- References: <fk2v35$n96$1@smc.vnet.net> <fk5akt$5jc$1@smc.vnet.net> <fk74bj$6pt$1@smc.vnet.net>
Hi,
you need to give the variables in the statement:
mem[y_]:=MemberQ[{u1,u2,u3,u4,u5,u6},y];
If you introduce other variables, you must change the list {u1,...} to
whatever your variables will be.
Hope this helps, Daniel
KFUPM wrote:
> On Dec 17, 11:05 am, dh <d... at metrohm.ch> wrote:
>> Hi,
>>
>> we may create a rule that sets all products of u^s to zero:
>>
>> mem[y_]:=MemberQ[{u1,u2,u3,u4,u5,u6},y];
>>
>> rules={y1_ y2_/;mem[y1]&&mem[y2]->0,y_^_/;mem[y]->0};
>>
>> here is an example:
>>
>> c1 u1+c2 u2+ c15 u1 u5 + c146 u1 u4 u6 /. rules
>>
>> hope this helps, Daniel
>>
>>
>>
>> KFUPM wrote:
>>> Dear all
>>> I have a very large expression which involves the multiplication of
>>> these variables:
>>> var ={u1,u2,u3,u4,u5,u6} with some other constants. In the expression,
>>> i want to suppress any quadratic or higher order multiplication of
>>> these varibles , e.g u1*u5 or u1*u4*u6 should be zero. And since, my
>>> expression is huge, i want to do this automatically. Any help in this
>>> regard is highly appreciated.
>>> Sincererly yours,
>>> HMQ- Hide quoted text -
>> - Show quoted text -
>
> Thanks for your reply.
>
> The rule didn't work for this term:
>
> Out[103]=
> \!\(\*
> RowBox[{\(5\/2\), " ", \(b\^4\), " ", \(x[2]\^4\), " ",
> RowBox[{
> SuperscriptBox["u11",
> TagBox[\((1, 0, 0)\),
> Derivative],
> MultilineFunction->None], "[", \(x[1], x[3], t\), "]"}], " ",
> RowBox[{
> SuperscriptBox["u13",
> TagBox[\((1, 0, 0)\),
> Derivative],
> MultilineFunction->None], "[", \(x[1], x[3], t\), "]"}]}]\)
>
> Please note that b is a constant. So the varibles are only u11 u13.
>
> I appreciate your help in this regard.
>
> Thanks in anticipation.
>
>