Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Plotting a series of Roots
Replies: 2   Last Post: Nov 27, 2012 3:32 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
David Park

Posts: 1,557
Registered: 5/19/07
Re: Plotting a series of Roots
Posted: Nov 18, 2012 3:58 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

William,

Have you looked at the pieces of your construction? Before compounding one
complex expression inside another and then wondering why the whole thing
doesn't work, why not look at the steps on their own, outside of the
Manipulate? Looking at the beginning, s1 is just a simple straight line
through the origin, and t1 is just a constant. I don't see what is
interesting about that. Maybe something interesting comes later? It looks
like you are "multiplying" a Plot times a Column and I don't understand what
that could mean.

I think you would make more progress if you developed the parts of your
construction first and made sure they worked and returned the entities you
were expecting and only then put together the Manipulate presentation.


David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/index.html



From: William Duhe [mailto:wjduhe@loyno.edu]


Bellow is a program that solves a diff eq, then finds a particular valued
root for that eq. What I want to do is be able to plot how the root changes
as a function of Lambda.





m = Manipulate[Module[
{ti, tf, s1},
imgSize = 375;

ti = 0;(*initial time*)
tf = 100;(*final plot time*)


s1 = NDSolve[{x'[t] == lambda, x[0] == 0}, x, {t, ti, tf}][[1]];

t1 = FindRoot[x[t] == .1 /. s1, {t, tf}];

delta[lambda] :=
Module[{times, v, s = s1[lambda]},
times = Quiet[
Chop[FindRoot[x[t] == .1 /. s, {t, #}] & /@ {tf - 1, ti + 1}]];
v = Flatten[x[t] /. s /. times];
Subtract @@ v];
Plot[delta[lambda], {lambda, 0, .007}, Frame -> True,
Axes -> False,
FrameLabel -> {"lambda", "Change in value of root"},
ImageSize -> imgSize,
Epilog -> {Text[ToString[pt, TraditionalForm], pt, {-1.25, 1}],
Red, AbsolutePointSize[4], Point[pt]}]

Column[{Plot[Evaluate[{Tooltip[x[t] /. s1, "x[t]"]}], {t, ti, tf},
PlotRange -> Automatic, AxesLabel -> {"Time", "functions"},
ImageSize -> 350, Exclusions -> Automatic],
Row[{"x[t] = 1 when ",
t1 =
Quiet[Chop[
FindRoot[x[t] == .1 /. s1, {t, #}] & /@ {tf, ti}]]}],

"\n\n"}]], {{lambda, .001}, 0.001, 0.007,
Appearance -> "Labeled"}]





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.