MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to use the result of Solve in Plot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111647] Re: How to use the result of Solve in Plot?
  • From: "David Park" <djmpark at comcast.net>
  • Date: Mon, 9 Aug 2010 05:12:02 -0400 (EDT)

It is not a hard and fast rule, but generally I would not put a lot of
symbolic or numerical calculation inside the various plot statements.
Rather, generate and define the function to be plotted outside the plot
statement where you can check it and debug it, and then put that into the
plot statement.

So here, we define a function y[x].

sol = First@Solve[{5*x + 4*y == 12}, {y}];
y[x_] = y /. sol 

1/4 (12 - 5 x) 

and then plot it.


Plot[y[x], {x, 0, 2}] 


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  



From: Eduardo M. A. M.Mendes [mailto:emammendes at gmail.com] 

Hello

I want to use the result of Solve[{5*x+4*y==12},{y}] in Plot[.,{x,0,2}].
Plot[Solve[.],{x,0,2}] does not work.

Many thanks

Ed

PS. I am new to Mathematica.




  • Prev by Date: Re: Random points in triangle
  • Next by Date: Re: How to use the result of Solve in Plot?
  • Previous by thread: How to use the result of Solve in Plot?
  • Next by thread: Re: How to use the result of Solve in Plot?