Re: Having some trouble with plot and solve

• To: mathgroup at smc.vnet.net
• Subject: [mg115515] Re: Having some trouble with plot and solve
• From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
• Date: Thu, 13 Jan 2011 03:27:09 -0500 (EST)
• References: <iggq4i\$4du\$1@smc.vnet.net>

```There were a few unfamilliar codes in your examples following the
variable name g. I just removed them assuming they were not essential.

The problem with your final plot is that you have the arguments tot
Manipulate and Plot in the wrong order. The following works

Manipulate[
Plot[y /. Solve[g[x0]*{x - x0} + f[x0] == y, y], {x, 0, 4000},
PlotRange -> {0, .006}], {x0, 0, 1500, 1, Appearance -> "Labeled"}]

I also added a second argument to Solve. The one argument version you
use is not listed in my documentation of Solve.

Cheers -- Sjoerd

On Jan 11, 6:34 am, r_berg <rberg1... at gmail.com> wrote:
> Hi i am new to mathematica, i have tried to combine this simple
> problem of showing a Reaction speed but i cannot plot the tangent line
> on a plot, and i don't seem to be able to have my regression in the
> same notebook
>
> data = {{0, .005}, {100, .00465}, {200, .00432}, {400, .00374}, {600,
> \
> .00323}, {900, .00260}, {1200, .00209}, {1500, .00168}};
> N2O5 = Exp[Fit[data /. {x_, y_} -> {x, Log[y]}, {1, x}, x]] //
>   Simplify (*not in same notebook as the rest*)
>
> f[x_] := 0.00499929 E^(-0.000726892 x) (*this works*)
> g=B4[x_] := -3.63394*10^-6 E^(-0.000726892 x) (*this works*)
>
> Plot[0.00499929 E^(-0.000726892 b), {b, 0, 4000},
>  PlotRange -> {0, .006}](*this works*)
>
> Show[Plot[0.00499929 E^(-0.000726892 x), {x, -1000, 4000}],
>  ListPlot[data, PlotRange -> {0, .006}, PlotStyle -> {Red}]] (*this
> works*)
>
> Manipulate[
>  Solve[g=B4[x0]*{x - x0} + f[x0] == y], {x0, 0, 1500, 1, Appearan=
ce ->
> "Labeled"}] (*this works*)
>
> But i cannot combine it together, not even this small thing
> Manipulate[
>  Plot[y /. Solve[g\.b4[x0]*{x - x0} + f[x0] == y], {x0, 0, 1500, 1,
>    Appearance -> "Labeled"}], {x, 0, 4000}, PlotRange -> {0, .006}]
>