Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

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

Search the Archive

Re: Solution of diff. equation i the form of list?

  • To: mathgroup at
  • Subject: [mg5526] Re: [mg5517] Solution of diff. equation i the form of list?
  • From: "w.meeussen" <w.meeussen at>
  • Date: Thu, 19 Dec 1996 01:02:28 -0500
  • Sender: owner-wri-mathgroup at

At 19:26 14-12-96 -0500, you wrote:
>Can you write how to get the solution of differential 
>equation in the form of list.
>I tried to achievie it in that way: 
>data=Table[{x,z[x] /. %},{x,0.0,1.5,0.1}]
> and I got:
>{{{0.0,{1.0}},{0.1,{0.8}}, etc
>       ^   ^       ^   ^
>How to get rid of above extra {}'s? 
>If I use "data" list in "ListPlot[data]" function I got errors.
>If you know what to do please post or e-mail.
>Thanks in advance.
>             Best regards 
>             Wojtek Wlazlo
>             ufwlazlo at 
hi Wojtek,

simple :
data=Table[{x,z[x] /.Flatten[sol]},{x,0.0,1.5,0.1}]

does what you need.

What happened? DSolve generally gives a list of lists-of-rules as answer.
Your case is simply a one-element list. The Wolframians wisely see it as the
users task to extract the single element from its enveloping 'packaging'.
Hence the Flatten[sol].
Don't despair, you'll get used to the style, and get to depend on its

I wish you many more packaging to unwrap this christmas,

Dr. Wouter L. J. MEEUSSEN
w.meeussen at

  • Prev by Date: Re: Plotting with a simplex
  • Next by Date: Re: Calculating Sums Of Roots For Trans. Functions
  • Previous by thread: Solution of diff. equation i the form of list?
  • Next by thread: Help