MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Forcing mathematica to output a certain form

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108289] Re: Forcing mathematica to output a certain form
  • From: dh <dh at metrohm.com>
  • Date: Fri, 12 Mar 2010 07:13:54 -0500 (EST)
  • References: <hn2mkv$4bc$1@smc.vnet.net> <hn5c96$7ng$1@smc.vnet.net>

Hi Geico,
here is a rule that puts all terms containing y to the left and those 
not containing y to the right of the equal sign:

t1 = f[t] == h[t] y[t]^2 - g[t] y'[t];
t1 //. {
   Equal[x0___, x1___ + Longest[x2_ /; ! FreeQ[x2, y]] + x3___] :>
    Equal[-x2 + x0, x1 + x3],
   Equal[x1___ + Longest[x2_ /; FreeQ[x2, y]] + x3___, x0___] :>
    Equal[x1 + x3, x0 - x2]
   }

Daniel

On 09.03.2010 12:43, Geico Caveman wrote:
> On 2010-03-08 04:22:07 -0700, Bob Hanlon<hanlonr at cox.net>  said:
>
>>
>> expr = f[t] + g[t] y'[t] == h[t] y[t]^2;
>>
>> Reverse[Expand[
>>     Equal @@
>>      Solve[expr /.
>>         f[t] ->  -z*g[t], z][[1, 1]]] /.
>>
>>     z ->  -f[t]/g[t]]
>>
>> Derivative[1][y][t] - (h[t]*y[t]^2)/g[t] == -(f[t]/g[t])
>>
>> Expand[
>>    (First[expr] - Last[expr])/g[t]] == 0
>>
>> f[t]/g[t] - (h[t]*y[t]^2)/g[t] + Derivative[1][y][t] == 0
>>
>>
>> Bob Hanlon
>>
>> ---- Geico Caveman<spammers-go-here at spam.invalid>  wrote:
>>
>> =============
>> As a result of an Eliminate function, and subsequent (wrapper)
>> simplification under some conditions, I am getting a non-linear
>> differential equation.
>>
>> It looks like:
>>
>> f(t)+g(t) y'(t)=h(t) y^2(t)
>>
>> Is there a way to force mathematica to output this in the way a
>> differential equation is best written:
>>
>> y'(t)+h(t)/g(t) y^(t) = -f(t)/g(t)
>>
>> or
>>
>> the transposed form with zero on RHS ?
>
> Thanks for your response (and the other person's response).
>
> So, I take it that there is no way to tell Mathematica to output it in
> a standard form for differential equations, short of "doing it by hand"
> ?
>


-- 

Daniel Huber
Metrohm Ltd.
Oberdorfstr. 68
CH-9100 Herisau
Tel. +41 71 353 8585, Fax +41 71 353 8907
E-Mail:<mailto:dh at metrohm.com>
Internet:<http://www.metrohm.com>



  • Prev by Date: Re: Re: Integrate bug
  • Next by Date: Re: bad Mathieu functions
  • Previous by thread: Re: Forcing mathematica to output a certain form
  • Next by thread: ReplaceRepeated in case of non ordered expressions