0
|
9206 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# How to plot with unknown variables? (geometric constructions)

Posted 10 years ago
 How can one do geometric constructions with unknown variables in Mathematica? If: p[x_] := x^2 + 2 x - 3 Plot[p[r], {r, -2 r, 2 r}] Then error: Plot::plln: Limiting value -2 r in {r,-2 r,2 r} is not a machine-sized real number. >>
3 Replies
Sort By:
Posted 10 years ago
 I'm not sure this is considered good programming practice in mathematica but perhaps you could do the following: Table[Plot[p[x], {x, -2 r, 2 r}],{r,1,10}] where r spans 1 through 10 in steps of 1.
Posted 10 years ago
 Hi,I am not sure what you want to achieve, but Plot is a procedure which needs fixed bounds for the range, such as: p[x_] := x^2 + 2 x - 3; Plot[p[r], {r, -20 , 20 }] If you want to try different ones you might want to use Manipulate: Manipulate[Plot[p[r], {r, -2 RR , 2 RR }], {{RR, 1}, 0.1, 20}] You will get a Slider and get get something like this:Hope this helps,Marco
Posted 10 years ago
 This was probably a poor example of what I want to do. But I think the issue is Plot won't attempt to decide if a function can be plotted without numerical values.For example f(x)=x is a known 'shape' over any domain. Instead of assigning numerical input values can we just define the domain of x and/or exclude certain problem values? I noticed the Plot[,{x}?reg] but not sure how it works.Edit: p.s. the Manipulate idea is a good workaround