       Re: Drawing function with 3 variables in a graph

• To: mathgroup at smc.vnet.net
• Subject: [mg71941] Re: Drawing function with 3 variables in a graph
• From: royend at gmail.com
• Date: Tue, 5 Dec 2006 06:04:39 -0500 (EST)
• References: <ekmefu\$8hs\$1@smc.vnet.net><ekp4ie\$2al\$1@smc.vnet.net>

```I guess my problem is still this:
With[{m=100, a = 1}, Plot{ f[x,m], {x,-5,5}]]

f contains several smaller functions, which uses a as their variable.
But it doesn't seem like the variable a is passed on to the functions
inside f[x,m]...

I had hoped that this would set a = 1 and m=100, and then calculate the
rest with x varying from -5 to 5.

Thanks for all your tips and advices. I will post back later if I find
a solution, and hope you will too if you find something.

Jens-Peer Kuska skrev:
> Hi,
>
> g[a_] := a/2
> f[t_, m_] := m*g[a]^t
>
> myfun[aa_, t_, m_] := Block[{a = aa},
>      f[t, m]
>      ]
>
> Plot[Evaluate[{Table[myfun[0.5, t, m], {m, 0, 5}]}], {t, -20, 20}]
>
> Regards
>    Jens
>
> royend at gmail.com wrote:
> > I want to draw a fairly complex function several times in one graph. By
> > using different colour I hope to present the development of my function
> > as the three variables changes.
> >
> > Earlier I have managed two variabels by using this:
> > Plot[Evaluate[ { Table[ f[t,m], {m,0,5}] } ], {t,-20,20},
> > PlotStyle->etc]
> >
> > But this time I have met difficulties because one of my variables are
> > "hidden" inside the function f(t,m), like this:
> > g(a) = a/2
> > f(t) = m*g(a)^t
> > m,a and t are variables.
> >
> > Therefore I need to control 3 variables and have tried this:
> > With[ {a=5}, Plot[ same as above]....
> >
> > I have read some about lists, graphics and so on but still haven't been
> > able to find any solution.
> > Do you have any tips for solving this?
> >

```

• Prev by Date: Re: Re: Ask Mathematica to sub for a long expression
• Next by Date: RE: Making plots using transformation rules
• Previous by thread: RE: Drawing function with 3 variables in a graph
• Next by thread: Re: Drawing function with 3 variables in a graph