Fitting a function in mathematica

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
elionix
Messages
15
Reaction score
0
Say I have a function:

f(x,y)

I have values for f and y such that I can make a plot of f vs y... however, from the values of f and y, I am interested in finding what x is. The x value should be a constant that is optimized to fit the f vs y graph.

Is there a way I can do this in mathematica?

Thank you for any advice!
 
Physics news on Phys.org
Okay, I'm a bit confused by your problem.

you mean, taking a specific example, for instance [itex]f(x,y)=(xy)^3[/itex]? Then, if you know for instance f(x,y)=14 and y=pi/2, that x should be [itex]\frac{14^{1/3}}{pi/2}[/itex]. Using that you can then see that [itex]f(x,y)=f(y)=(\frac{14^{1/3}}{pi/2} y)^3[/itex]. Trying the mathematica functions Solve and Plot should get you on your way.