Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15277

Re: Differencing two equations

From nma%12000.org@gtempaccount.com
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Differencing two equations
Date 2013-08-04 09:16 +0000
Message-ID <ktl64q$h81$1@smc.vnet.net> (permalink)
References <20130210082414.C3A5F6937@smc.vnet.net> <kfae39$m53$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


On Monday, February 11, 2013 3:36:41 AM UTC-6, Bob Hanlon wrote:
> eqnOperate[eqn1_, eqn2_, f_] :=
> 
>   Equal @@ f @@ {List @@ eqn1, List @@ eqn2};
> 
> eqnOperate[a == r, b == s, Subtract]
> 
> 
> a - b == r - s
> 

Hello;

Do you know why this case of subtracting 2 equations does not produce the expected result using your function above?

------------------------------

eqnOperate[eqn1_, eqn2_, f_] := 
  Equal @@ f @@ {List @@ eqn1, List @@ eqn2}; 

eqn1 = 8*(-f[-h + x] + f[h + x] == 2*h*Derivative[1][f][x]); 
eqn2 = -f[-2*h + x] + f[2*h + x] == 
   4*h*Derivative[1][f][x] + (8/3)*h^3*Derivative[3][f][x] + 
         (8/15)*h^5*Derivative[5][f][x]; 

eqnOperate[eqn1, eqn2, Subtract]
-------------------------------------

Out[4]= 8 + f[-2*h + x] - 
  f[2*h + x] == (-f[-h + x] + f[h + x] == 2*h*Derivative[1][f][x]) - 
  4*h*Derivative[1][f][x] - 
     (8/3)*h^3*Derivative[3][f][x] - (8/15)*h^5*Derivative[5][f][x]

You can see the result has too many '==' inside it. 

thanks,
--Nasser

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: Differencing two equations Bob Hanlon <hanlonr357@gmail.com> - 2013-02-11 09:36 +0000
  Re: Differencing two equations nma%12000.org@gtempaccount.com - 2013-08-04 09:15 +0000
  Re: Differencing two equations nma%12000.org@gtempaccount.com - 2013-08-04 09:16 +0000

csiph-web