Re: plot

• To: mathgroup at smc.vnet.net
• Subject: [mg58191] Re: plot
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Wed, 22 Jun 2005 01:55:34 -0400 (EDT)
• Organization: The Open University, Milton Keynes, England
• References: <d98pto\$elv\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Bosch, Darrell wrote:
> Dear Group,  Thanks to several of you for providing good suggestions to
> my previous inquiry.  In the program below I am trying to solve an
> equation for v, derive the solution with respect to size, and plot the
> resulting solution.  The problem I have is in running the plot command.
> I am trying to set numerical values for variables in the derivative
> (other than size) and plot the derivative for size, but Mathematica
> won't recognize the settings for the other values. Would appreciate any
> suggestions.  Darrell
>
>
> sol=Log[v]==-0.829923*(Log[size])+0.05652*(Log[size])^2+.000737*(Lo=
> g[siz
> e])^3-.002805*pop+.288472*(Log[elev])-.020531*soil1-.086192*soil2-.10992
> 9*Log[x]+.15501*Log[y]-.192311*Log[mall]+.024088*Log[town]+.044958*year
>
>  sol2=Solve[sol,v]
>
>  sol3=D[v /.  sol2[[1]],size]
>
>  Plot [Evaluate[sol3/. elev(r)379.82, soil1(r)0,
> soil2(r)1,mall(r)8861.89,town(r)8828.68,pop(r)5.9,x(r)24888.27,y(r)16881
> ..90,year(r)0,{size,100,1000}]]
>
>
Hi Darrell,

In[1]:=
Lo = g[size]

Out[1]=
g[size]

As a rule of thumb, I would avoid using assignment within assignment.
Since I do not know what the function g is, I just set it to the identity.

In[2]:=
Lo = 1

Out[2]=
1

In[3]:=
sol = Log[v] == -0.829923*Log[size] +
0.05652*Log[size]^2 + 0.000737*Lo^3 -
0.002805*pop + 0.288472*Log[elev] -
0.020531*soil1 - 0.086192*soil2 -
0.109929*Log[x] + 0.15501*Log[y] -
0.192311*Log[mall] + 0.024088*Log[town] +
0.044958*year

Out[3]=
Log[v] == 0.000737 - 0.002805*pop - 0.020531*soil1 -
0.086192*soil2 + 0.044958*year +
0.288472*Log[elev] - 0.192311*Log[mall] -
0.829923*Log[size] + 0.05652*Log[size]^2 +
0.024088*Log[town] - 0.109929*Log[x] +
0.15501*Log[y]

In[4]:=
sol2 = Solve[sol, v]

Out[4]=
{{v -> (1.0007372716512315*E^(-0.002805*pop -
0.020531*soil1 - 0.08619200000000002*soil2 +
0.044958000000000005*year +
0.05652*Log[size]^2)*
elev^
0.2884720000000000061923799421`15.954589770191\
005*town^
0.0240879999999999983018028615`15.954589770191\
005*
y^
0.1550100000000000088906659812`15.954589770191\
005)/
(mall^
0.1923110000000000097131191978`15.954589770191\
005*size^
0.8299229999999999662918526155`15.954589770191\
005*
x^
0.10992899999999999893773861`15.954589770191005)\
}}

In[5]:=
sol3 = D[v /. sol2[[1]], size]

Out[5]=
-((0.8305348787006049*E^(-0.002805*pop -
0.020531*soil1 - 0.08619200000000002*soil2 +
0.044958000000000005*year +
0.05652*Log[size]^2)*
elev^
0.2884720000000000061923799421`15.9545897701910\
05*town^
0.0240879999999999983018028615`15.9545897701910\
05*
y^
0.1550100000000000088906659812`15.954589770191005\
)/
(mall^
0.1923110000000000097131191978`15.9545897701910\
05*size^
1.8299229999999999662918526155`16.2979847854069\
46*
x^
0.10992899999999999893773861`15.954589770191005)) \
+ (0.1131233411874552*E^(-0.002805*pop -
0.020531*soil1 - 0.08619200000000002*soil2 +
0.044958000000000005*year +
0.05652*Log[size]^2)*
elev^
0.2884720000000000061923799421`15.95458977019100\
5*town^
0.0240879999999999983018028615`15.95458977019100\
5*y^0.1550100000000000088906659812`15.954589770191005*
Log[size])/
(mall^
0.1923110000000000097131191978`15.95458977019100\
5*size^
1.8299229999999999662918526155`16.29798478540694\
6*x^0.10992899999999999893773861`15.954589770191005)

In[6]:=
Plot[Evaluate[sol3 /. {elev -> 379.82, soil1 -> 0,
soil2 -> 1, mall -> 8861.89, town -> 8828.68,
pop -> 5.9, x -> 24888.27, y -> 16881*0.9,
year -> 0}, {size, 100, 1000}]];

In Mathematica, replacement rules are of the form expr1 -> expr2 and if
you have several of them, you just enclose them within curly braces.

Best regards,
/J.M.

```

• Prev by Date: Re: Transformation rule problem
• Next by Date: Re: a question about plot a list of functions.
• Previous by thread: Re: plot
• Next by thread: Re: Re: plot