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


Groups > comp.soft-sys.math.mathematica > #5414

Table NDSolve Plot

From Howie <hcohl001@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Table NDSolve Plot
Date 2011-10-06 08:23 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j6joh8$m3g$1@smc.vnet.net> (permalink)

Show all headers | View raw


I know this is a basic question, but I am having a hard time figuring
this out on my own.

I would like to numerically solve an ordinary differential equation
with a parameter which varies over a range of numbers and plot all the
solutions with different values of the parameter on the same plot.
Also, I would like to be able to then over-plot another solution on
the same plot.

For instance:

h=0
n=0
k=0.25
s = NDSolve[{(h - k^2 n (1 + n) z^2) w[z] -
     z (1 + k^2 - 2 k^2 z^2) Derivative[1][w][
       z] + (1 - z^2) (1 - k^2 z^2) (w^\[Prime]\[Prime])[z] == 0,
   w[2] == 1, w'[2] == -1}, w, {z, 1.1, 3.0}]
Plot[Evaluate[w[z] /. s], {z, 1.1, 3.0}, PlotStyle -> Automatic]
Plot[1/2 Log[(z + 1)/(z - 1)], {z, 1.1, 3.0}, PlotStyle -> Automatic]
I would like to do this for instance 10 increments of k from 0 to 1,
and also the Log plot, all on the same plot.

Thanks!

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Table NDSolve Plot Howie <hcohl001@gmail.com> - 2011-10-06 08:23 +0000
  Re: Table NDSolve Plot Peter Pein <petsie@dordos.net> - 2011-10-07 08:56 +0000

csiph-web