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


Groups > comp.soft-sys.math.mathematica > #9265 > unrolled thread

Schaums outline Mathematica 2nd ed, prob. 11.3 help

Started by"pennsylvaniajake@gmail.com" <pennsylvaniajake@gmail.com>
First post2012-03-29 08:02 +0000
Last post2012-03-30 09:42 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Schaums outline Mathematica 2nd ed, prob. 11.3 help "pennsylvaniajake@gmail.com" <pennsylvaniajake@gmail.com> - 2012-03-29 08:02 +0000
    Re: Schaums outline Mathematica 2nd ed, prob. 11.3 help David Reiss <dbreiss@gmail.com> - 2012-03-30 09:42 +0000

#9265 — Schaums outline Mathematica 2nd ed, prob. 11.3 help

From"pennsylvaniajake@gmail.com" <pennsylvaniajake@gmail.com>
Date2012-03-29 08:02 +0000
SubjectSchaums outline Mathematica 2nd ed, prob. 11.3 help
Message-ID<jl14v2$lbd$1@smc.vnet.net>
I cannot get this code to show the solutions to the equation, only the vector plot.  Whats wrong?  It came from Schum's Outline, Mathematica 2n ed, solved problem 11.3 on page 272-3.  The only changes I made was using v1 for vf and s1 for solutions.

v1 = VectorPlot[{1, x^2 + y}, {x, 0, 1}, {y, 0, 12}, 
   Axes -> Automatic, VectorScale -> Tiny];

s1 = Table[
   DSolve[{y'[x] == X^2 + y[x], y[0] == k}, y[x], x], {k, 0, 4}];

Do[g[k] = 
  Plot[s1[[k, 1, 1, 2]], {x, 0, 1}, PlotStyle -> Thickness[0.007], 
   PlotRange -> All], {k, 1, 5}]

Show[g[1], g[2], g[3], g[4], g[5], v1, Frame -> True, 
 AspectRatio -> 1]

[toc] | [next] | [standalone]


#9312

FromDavid Reiss <dbreiss@gmail.com>
Date2012-03-30 09:42 +0000
Message-ID<jl3v64$3nu$1@smc.vnet.net>
In reply to#9265
One of the x's in your Dsolve is a capital X rather than a lower case
x.

Use

DSolve[{y'[x] == x^2 + y[x], y[0] == k}, y[x], x], {k, 0, 4}];

rather than

DSolve[{y'[x] == X^2 + y[x], y[0] == k}, y[x], x], {k, 0, 4}];

--David


On Mar 29, 4:02 am, "pennsylvaniaj...@gmail.com"
<pennsylvaniaj...@gmail.com> wrote:
> I cannot get this code to show the solutions to the equation, only the vector plot.  Whats wrong?  It came from Schum's Outline, Mathematica 2n ed, solved problem 11.3 on page 272-3.  The only changes I made was using v1 for vf and s1 for solutions.
>
> v1 = VectorPlot[{1, x^2 + y}, {x, 0, 1}, {y, 0, 12},
>    Axes -> Automatic, VectorScale -> Tiny];
>
> s1 = Table[
>    DSolve[{y'[x] == X^2 + y[x], y[0] == k}, y[x], x], {k, 0, 4}];
>
> Do[g[k] =
>   Plot[s1[[k, 1, 1, 2]], {x, 0, 1}, PlotStyle -> Thickness[0.007],
>    PlotRange -> All], {k, 1, 5}]
>
> Show[g[1], g[2], g[3], g[4], g[5], v1, Frame -> True,
>  AspectRatio -> 1]

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web