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: [mg108235] Re: Forcing mathematica to output a certain form
  • From: magma <maderri2 at gmail.com>
  • Date: Thu, 11 Mar 2010 06:37:01 -0500 (EST)
  • References: <hn2mkv$4bc$1@smc.vnet.net> <hn5c96$7ng$1@smc.vnet.net>

On Mar 9, 12:43 pm, Geico Caveman <spammers-go-h... at spam.invalid>
wrote:
> On 2010-03-08 04:22:07 -0700, Bob Hanlon <hanl... 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-h... 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"
> ?

No, you come to the wrong conclusion.
The task you require is not too difficult to program.
You can create a function which takes an equation (== sign) and
rearranges everything as you wish.
You need to learn programming Mathematica a bit. It is well worth.
I have no time to do it for you right now.
Perhaps some other member.
Try yourself. It is a very rewarding experience.


  • Prev by Date: Re: ZTransform for a non-causal unstable signal. How to make Mathematica gives correct result?
  • Next by Date: Re: gaps in plot of piecewise function
  • Previous by thread: Re: Forcing mathematica to output a certain form
  • Next by thread: Re: Forcing mathematica to output a certain form