Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9308 > unrolled thread
| Started by | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| First post | 2012-03-30 09:41 +0000 |
| Last post | 2012-03-30 09:41 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Schaums outline Mathematica 2nd ed, prob. 11.3 help Bob Hanlon <hanlonr357@gmail.com> - 2012-03-30 09:41 +0000
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Date | 2012-03-30 09:41 +0000 |
| Subject | Re: Schaums outline Mathematica 2nd ed, prob. 11.3 help |
| Message-ID | <jl3v56$3no$1@smc.vnet.net> |
First, in the definition of s1 replace X with x.
Do does not provide an output. Either wrap its Plot with Print
(behavior of Plot changed since book was written) to cause an output
or replace the Do with Table.
Do[
Print[g[k] = Plot[s1[[k, 1, 1, 2]],
{x, 0, 1},
PlotStyle -> Thickness[0.007],
PlotRange -> All]],
{k, 1, 5}]
or
Table[
g[k] = Plot[s1[[k, 1, 1, 2]],
{x, 0, 1},
PlotStyle -> Thickness[0.007],
PlotRange -> All],
{k, 1, 5}]
Bob Hanlon
On Thu, Mar 29, 2012 at 3:59 AM, pennsylvaniajake@gmail.com
<pennsylvaniajake@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]
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web