Mathematica 9 is now available
Student Support Forum
Student Support Forum > General > > "Plotting non-linear values and solving"

Post Reply:
Email Address:

Please send email when my message is replied to.

Url (optional):
Message: view original message?
Attachment (optional):
Please answer this:4+2 =

Original Message (ID '74977') By Bill Simpson:
In Response To 'Re: Re: Re: Re: Plotting non-linear values and ...' --------- An assortment of responses, in no particular order. When I'm pasting a Mathematica expression into a forum response I usually append //InputForm to the end of the expression, evaluate the code, then scrape the nice linear output to the clipboard and paste it. That gets rid of things like x y= --- 4 and such. BUT I try to be careful to check the result to make sure I haven't mangled something. I also have to be careful and remove the //InputForm and evaluate again before using the result of the calculation elsewhere in the notebook. You asked "How does the FindFit or Solve function know to set the y values, if we are calling it y1?" Read the help page for FindFit. It expects FindFit[data,expr,pars,vars] Your list of measured values is in the data position so FindFit knows to use it as such. Your y1 is in the expr position and FindFit knows to use it. You could use myShoeILost= your expression and use myShoeILost for the expr and it would work equally well. You could also just paste your expression into the expr position. All are the same. You ask "my x in the equation below is showing again does the FindFit or Solve function know to assign the coordinate {x,y} values once data has been defined?" Yes, because you use x in the correct position in the FindFit. You ask "Now, I am not fully convinced that y and x in the equation are using the coordinate values in the calculation." Very valuable method. Create some VERY simple data and a very simple expression and try FindFit to see if it works correctly. For example, data={{1,2},{2,3},{4,5}}; y1=k*x; FindFit[data,y1,k,x] or something equally simple. Please check this example carefully to see it is correct. Check that what I have done matches the help pages. Check that it is similar to your original problem. See if the result is correct. Then change the variable names and see if it correctly works. You are trying to gain confidence in the tools you are using. Without that it is very difficult to trust the answers. You ask why it works by hand and why Mathematica cannot do this. You probably have "mathematical sense." That means you ignore some things and do the sensible things. Mathematica often has no such sense. It is a very large collection of rules. It follows those rules. It is very unlike you having a very good graduate student who you pay to solve problems for you and who knows what mathematics means. I am busy at the moment and it may be a day or two before I get time to look at your problem and see what I can make of it.