Plot inverse function Mathematica

Click For Summary

Discussion Overview

The discussion centers around plotting an inverse function using Mathematica, specifically addressing the process of solving an equation and extracting the result for plotting. Participants also discuss issues related to labeling axes when using frames in plots.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Homework-related

Main Points Raised

  • One participant seeks guidance on how to plot the inverse function derived from the equation x == a * Log[y/100].
  • Another participant suggests stripping out the result from the brackets to obtain the function for plotting.
  • There is a mention that when using "Frame->True", the "AxesLabel" should be changed to "FrameLabel" to display correctly.
  • A participant expresses confusion about the extraction process used to obtain the function from the solution set and seeks clarification on the methodology.
  • Further clarification is provided on how to navigate the nested brackets in the solution set to extract the desired function.

Areas of Agreement / Disagreement

Participants generally agree on the method for extracting the function from the solution set, but there is no consensus on the best way to handle axis labeling when using frames.

Contextual Notes

Participants discuss the extraction of values from nested lists in Mathematica, which may depend on the specific structure of the solution set. The discussion does not resolve the issue of axis labeling in plots.

Who May Find This Useful

Users of Mathematica looking to plot inverse functions and those encountering issues with axis labeling in graphical representations may find this discussion beneficial.

meridian
Messages
3
Reaction score
0
I want to plot inverse function using Mathematica
Code:
In[1]:=f = Solve[x == a * Log[y/100], y]

Out[2] = {{y -> 100 E^(x/a)}}
and then? how to use this reult to plot?

ThanksAnother question is about the axeslabel, when I set the Frame->True, the AxesLabel can not be displayed correctly, where the label of x-coordinate is correct, but that of y-coordinate is missing, How to solve this problem?

thanks again
 
Last edited:
Physics news on Phys.org
You can strip out the result from the brackets:

Code:
In[209]:= f = Solve[x == a*Log[y/100], y]
Out[209]= {{y->100 E^(x/a)}}
In[212]:= F = f[[1]][[1]][[2]]
Out[212]= 100 E^(x/a)

Then Plot[F,{x,-3,3}] to plot. (assuming you have a value for "a")
 
Also, once you use "Frame-> True" you need to change your "AxisLabel" to a "FrameLabel". That should solve it.
 
Hepth said:
You can strip out the result from the brackets:

Code:
In[209]:= f = Solve[x == a*Log[y/100], y]
Out[209]= {{y->100 E^(x/a)}}
In[212]:= F = f[[1]][[1]][[2]]
Out[212]= 100 E^(x/a)

Then Plot[F,{x,-3,3}] to plot. (assuming you have a value for "a")



I am completely a beginner therefore I would like to ask what you did in the In[212].. i mean what is the philosophy behind it..

Thank you in advance

Yannis
 
ok:
209: I set f is the solution set {{y->100 ...}} etc
212: I basically say, take the 2nd component of the 1st component of the 1st component of "f"

So you have :
{{y->100 E^(x/a)}}[[1]] = {y->100 E^(x/a)}
{{y->100 E^(x/a)}}[[1]][[1]] = y->100 E^(x/a)
{{y->100 E^(x/a)}}[[1]][[1]][[2]] = 100 E^(x/a)

Basically the {}{} brackets are like a set, or table. And since its doubly thick {{X-> Y}} You need to pull out "Y".
the [[1]] and [[2]] takes the first or second or whatever value of the set preceeding it.
{1,2,3,4,3,2,1}[[5]] = 3 (indexed the 5th component)

If there were two solutions you would get to choose. Notice:

In[11]:= f = Solve[x^2 == 4, x]
Out[11]= {{x->-2},{x->2}}
In[12]:= f[[1]]
Out[12]= {x->-2}
In[13]:= f[[2]]
Out[13]= {x->2}
 
Hepth said:
ok:
209: I set f is the solution set {{y->100 ...}} etc
212: I basically say, take the 2nd component of the 1st component of the 1st component of "f"

So you have :
{{y->100 E^(x/a)}}[[1]] = {y->100 E^(x/a)}
{{y->100 E^(x/a)}}[[1]][[1]] = y->100 E^(x/a)
{{y->100 E^(x/a)}}[[1]][[1]][[2]] = 100 E^(x/a)

Basically the {}{} brackets are like a set, or table. And since its doubly thick {{X-> Y}} You need to pull out "Y".
the [[1]] and [[2]] takes the first or second or whatever value of the set preceeding it.
{1,2,3,4,3,2,1}[[5]] = 3 (indexed the 5th component)

If there were two solutions you would get to choose. Notice:

In[11]:= f = Solve[x^2 == 4, x]
Out[11]= {{x->-2},{x->2}}
In[12]:= f[[1]]
Out[12]= {x->-2}
In[13]:= f[[2]]
Out[13]= {x->2}


Great! Just on time since I was trying to do exactly what u illustrate in your last example..thank u very much!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K