MathGroup Archive 2012

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

Search the Archive

Re: Clean output of mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129081] Re: Clean output of mathematica
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Thu, 13 Dec 2012 04:08:02 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20121212005617.818F1691F@smc.vnet.net>

s = DSolve[
     {y''[x] == -a^2 y[x], y[0] == 0},
     y, x][[1]] /. C[2] -> 2;

t = {Factor[a /.
       Solve[#, a][[1]] & /@
     Simplify[
      Reduce[{(y[L] /. s) == 0, L != 0}, a],
      {Element[C[1], Integers],
       L != 0}]] /.
   (2 C[1] x_ || (2 C[1] + 1) x_) :> n*x}

{(n*Pi)/L}


Bob Hanlon


On Tue, Dec 11, 2012 at 7:56 PM, AZEEM MIR <docpasmon at gmail.com> wrote:
> Dear All
> Following code solves the 2nd order differential equation.
>
> s = DSolve[{y''[x] == - a^2 y[x]}, y, x]
> t = Reduce[y[0] == 0 && y[L] == 0 && C[1] == 0 && C[2] ==
= 2 /. s, a]
>
> These give output
>
> {{y->({x}\[Function]Subscript[c, 2] sin(a x)+Subscript[c, 1] cos(a x))}}
>
> Subscript[c, 3]\[Element]\[DoubleStruckCapitalZ]\[And]((Subscript[c, 1]\[LongEqual]0\[And]Subscript[c, 2]\[LongEqual]2\[And](L\[LongEqual]0\[Or](L!=0\[And]a\[LongEqual](2 \[Pi] Subscript[c, 3])/L)))\[Or](L!=0\[And]Subscript[c, 1]\[LongEqual]0\[And]Subscript[c, 2]\[LongEqual]2\[And]a\[LongEqual](\[Pi] (2 Subscript[c, 3]+1))/L))
>
> Now it is possible to extract the possible eigen values of a but that is not efficient automation. I wish to write a program that effectively plots eigenvalues solution without customizing the extract command each time.
>
> Is it possible to produce a clean output like all possible eigen-values enclosed by bracket defined by just{n Pi/L}. Sure it won't be so hard to overwrite some basic files.
>



  • Prev by Date: Help with visualization
  • Next by Date: Re: Recurrence Equation RSolve, no error shown, no solution?
  • Previous by thread: Clean output of mathematica
  • Next by thread: Help with visualization