1
$\begingroup$

I am trying to learn using Maple 18 (Mac). I have defined a function with a list of X and Y values.

f := x->LinReg(X, Y, x)

Now I would like to output the unknown "x" value that correlates with a known "y" value (e.g. 30). According to the instruction manual, that I have, the way to do it is using this command:

Output x command

I just can't figure out how to type "solve" with an arrow under it.

Any help would be appreciated.

EDITED: Screenshot of the commandwindow Screenshot of the commandwindow

$\endgroup$
  • $\begingroup$ Right click the expression once you have entered it and then click on solve in the menu that opens. That would give you the arrow with the solve $\endgroup$ – JEET TRIVEDI Dec 22 '14 at 1:16
  • 1
    $\begingroup$ You can also explicitly type the command solve(f(x)=30,x);. $\endgroup$ – Eff Dec 22 '14 at 1:21
  • $\begingroup$ In fact the solution by @Eff is better and is what's used most in practice as far as what I've seen $\endgroup$ – JEET TRIVEDI Dec 22 '14 at 1:28
  • $\begingroup$ Thanks to both of You. I have tried both solutions. @JEET TRIVEDI's solution gives me a lot of choices for "solve". Tried them all, but without any luck. @Eff solution also without luck. Problem might be something else? I just get a warning saying Warning, solving for expressions other than names or functions is not recommended. Error, (in solve) a constant is invalid as a variable, -3, -1, 1, 2, 4. $\endgroup$ – chmodder Dec 22 '14 at 1:34
  • $\begingroup$ Could you provide more context on what you are trying to solve? $\endgroup$ – JEET TRIVEDI Dec 22 '14 at 1:36
1
$\begingroup$

LinReg seems to be a command in some special package Gym, which is not part of standard Maple.

But here is what I might do using standard Maple.

> with(Statistics):
X:= [-3,-1, 1, 2,4];
Y:= [-1,0.5,5, 6,8];
F:= LinearFit(a*x+b, X, Y, x);

$$ F := 1.38356164383562\; x+2.86986301369863$$

> solve(F = 30, x);

$$19.60891089$$

$\endgroup$
  • $\begingroup$ You are right about the Gym package. I think either that or Maple might have been acting up, because after a lot of help from @JEET TRIVEDI, we where able to rule out the inputted commands. I restarted Maple and then It "magically" worked. Problem solved, but thank you for your input. $\endgroup$ – chmodder Dec 22 '14 at 2:43
1
$\begingroup$

I think either the installed expansion package "Gym" or Maple might have been acting up, because after a lot of help from @JEET TRIVEDI, we where able to rule out the inputted commands. I restarted Maple and then It "magically" worked. Problem solved. Thanks to everybody who helped me solve the problem.

Working

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.