Message Boards Message Boards

0
|
4296 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to create a plot with normalized axis?

Posted 3 years ago

Hi Community,

i need your help for my problem:

v[y_, w_] := v0 (Exp[w y/h] - 1)/(Exp[w] - 1)
h = 5;
v0 = 10;
Manipulate[Plot[v[y, w], {y, 0, 1}], {w, -10, 10}]

The plot should have axes with v/v0 and y/h. So the axes are in the range between 0 and 1 (and they should be fixed).

Hope you can help me! :-)

With kind regards, MM

POSTED BY: Mathe Matica
4 Replies

I think you should define v0 and h first and then define a normalized v say called vnorm which is your v /v0 and plot vnorm instead of v.

POSTED BY: Jack I Houng
Posted 3 years ago

Or Plot[v[y, w] / v0, ...]

POSTED BY: Rohit Namjoshi
Posted 3 years ago

Thanks for the fast reply! ;) Maybe I should explain my problem better.

v[y_, w_] := v0 (Exp[w y/h] - 1)/(Exp[w] - 1) (* Velocity *)
w; (* Dimensionless Number *)
h = 5;  (* Height of the Channel *)
v0 = 10; (* Velocity at the Beginning *)
Manipulate[
 Plot[v[y, w], {y, 0, h}, PlotRange -> {{0, 1}, {0, 1}}, 
  AxesLabel -> {"\!\(\*FractionBox[\(y\), \(h\)]\)", 
    "\!\(\*FractionBox[\(v\), \(v0\)]\)"}], {w, -10, 10}]

So, I have a fluid with a velocity at the beginning of v0 in a channel with the height h. As you can see in the term with the exponential functions, if y -> h, then the term -> 1.

Now I want a plot with normalized axis (look at my new code) v/v0 (Range: 0 to 1) and y/h (Range: 0 to 1). I also tried to use Rescale (just for the y/h axis), but it didn't work:

Manipulate[
 Plot[v[y, w], Rescale[{y, 0, h}, {0, 1}], 
  PlotRange -> {{0, 1}, {0, 1}}, 
  AxesLabel -> {"\!\(\*FractionBox[\(y\), \(h\)]\)", 
    "\!\(\*FractionBox[\(v\), \(v0\)]\)"}], {w, -10, 10}]
POSTED BY: Mathe Matica
Posted 3 years ago

You can fix the plot range by adding the following option to Plot

PlotRange -> {{0, 1}, {0, 1}}

Not sure what you mean by

have axes with v/v0 and y/h

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract