Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
x-start or x-finish for 2D graph as a variable?
10-04-2012, 05:21 PM (This post was last modified: 10-04-2012 06:13 PM by cliverlong.)
Post: #1
x-start or x-finish for 2D graph as a variable?
Hi,

Say I have the graph y = 2k and I want to plot this for x between -a and 0 (this is part of STEP I 2011 Q13)

I can enter the equation y = 2k and k is created as a variable.

I then click on "Startup options" and set "Manual / x-start" to "a" rather than a specific numeric value. I set x-finish = 0. Now the default value for any variable = 1, so that may be the problem. Anyway, Autograph replaces "a" to -6 and plots the horizontal line between x=-6 and x=0. I can't seem to make x-start or x-finish a variable.

Is there any way to achieve this?

Regards

Clive
Find all posts by this user
Quote this message in a reply
11-04-2012, 08:00 AM
Post: #2
RE: x-start or x-finish for 2D graph as a variable?
Dear Cliverlong,

Variables cannot be used in the x-start and x-finish fields so Autograph is automatically changing the value back to the default. Depending on what you are trying to do there are a couple of alternative methods you might try:

1. Add a point at (-a, -2a) and a point at (0, 0). Join the points with a line segment.

2. Create a function which is only defined for x > a.

Enter the function definition f(x) = (x − a + |x − a|)/(2(x − a)).

What do you think this function does? Trying plotting y = f(x).

How can this function be used with your original graph to make it undefined for x < a and the leave it unchanged for x > a?

Try plotting y = 2k/f(x) for x < a the denominator is 0 so the function is undefined, for x > a the denominator is 1 so the function is just y = 2k.

Best regards,

Simon
Visit this user's website Find all posts by this user
Quote this message in a reply
30-05-2012, 06:52 PM
Post: #3
RE: x-start or x-finish for 2D graph as a variable?
(11-04-2012 08:00 AM)Support Wrote:  Dear Cliverlong,

<< snip >>
2. Create a function which is only defined for x > a.

Enter the function definition f(x) = (x − a + |x − a|)/(2(x − a)).

What do you think this function does? Trying plotting y = f(x).

<< snip >>

Best regards,

Simon

I cheated and directly plotted the function for a full range of x values - and saw a step function, values 0 and 1 either side of a. Very neat. So if I multiply this by the other function I can, effectively, restrict the domain. If I "reverse" this step function then I can restrict the plot to x < a.

I will continue and complete the rest of the tasks to understand how it helps resolve my original question.

Thanks

Clive
Find all posts by this user
Quote this message in a reply
31-05-2012, 08:16 AM
Post: #4
RE: x-start or x-finish for 2D graph as a variable?
Hi Clive,

Whilst my reply contained the essence of the correct answer I'm afraid it appears that I did not read the question carefully enough. (The two major errors were me thinking of y = 2x when you actually wrote y = 2k, and using x > a instead of x > -a)

I should have written:

1. Add a point at (-a, 2k) and a point at (0, 2k). Join the points with a line segment.

This will look the same as plotting y = 2k for -a < x < 0.

2. Create a function which is only defined for x > -a.

Enter the function definition f(x) = (x + a + |x + a|)/(2(x + a)).

This function is zero for x < -a and 1 for x > -a.

Enter the function definition g(x) = 1 - (x + |x|)/(2x).

This function is 1 for x < 0 and 0 for x > 0.

Now plot y = 2k/(f(x)g(x))

When either f(x) or g(x) is zero this function is undefined. So it is only defined for -a < x < 0.

I hope that is all correct now. You might be better off sticking with option 1 for this example!

Simon
Visit this user's website Find all posts by this user
Quote this message in a reply
31-05-2012, 02:43 PM
Post: #5
RE: x-start or x-finish for 2D graph as a variable?
That all works fine. I need to go back to the original question and see how this can help solve the "bigger" question.

I will store away that function involving the modulus and make sure I understand why it works by looking at equivalent functions, with the modulus removed for points before, after and between -a and zero.

Thanks,

Clive
Find all posts by this user
Quote this message in a reply
08-06-2012, 10:20 AM (This post was last modified: 08-06-2012 10:31 AM by cliverlong.)
Post: #6
RE: x-start or x-finish for 2D graph as a variable?
I'm trying to use your "step function" to create some Autograph "minimax" demonstrations.

The starting idea is this. Set the perimeter of a shape to a fixed value, say 20. The initial shapes would be a rectangle or a sector. The objective is to find the length, l, of a side (rectangle) or angle (of sector) that gives the largest area. Algebraically this would be done by expressing the area, A as a function of length, l, then determining and solving dA/dl = 0.

My idea to use Autograph is to create the shape where the length of the parameter, length l or angle, is an Autograph variable. In the attached example I have created the rectangle using both "shape" and a small modification of the step function above (the function has value +1 over a small range of values of x starting at zero). I can create the rectangle either way and it responds as I want, i.e. re-shapes, when I vary the value of the parameter, a. However, the "shape" option does not offer a right-click option to calculate/estimate the area within the shape. The rectangle based on the "step" functions does offer the option to calculate the area but when it is selected Autograph just says this is an "invalid area". Is there a different approach to this?

Regards,

Clive

.agg  minimax.agg (Size: 4.9 KB / Downloads: 2)

.agg  minimax2.agg (Size: 8.81 KB / Downloads: 3)
A rider to this.

If I can get a value for the area then I would like to be able to plot the area (dependent) against the variable (independent) so I can see/show the graph actually has a maximum or minimum at a particular value of the variable that (hopefully) corresponds to the value determined algebraically (using differentiation).

Thanks

clive
Find all posts by this user
Quote this message in a reply
11-06-2012, 08:08 AM
Post: #7
RE: x-start or x-finish for 2D graph as a variable?
Hi Clive,

Both of the methods you have suggested are good.

Method 1

This is my favourite method. I would suggest hiding the points which make up the shape so the user cannot click and drag them. As you point out you cannot calculate the area from the shape directly. I would plot y = x(10 - x), add a point at x = a, run a horizontal line through that point and take the intersection with the y-axis. A line segment from this point to the origin will give you the area calculation a(10 - a). Select the line segment and choose Text Box to display the value.

Method 2
I opened this file and deleted the previous area calculations and hid the functions I did not require. Then I selected the green curve and choose Find Area. I set the start point to -1 and end point to 11 and set the number of rectangles to 1000. This produces what you are expecting to see.

This video provides a summary of both methods:

Either method would also work with circle sectors.

We would be very pleased if you posted the final activity.

Simon
Visit this user's website Find all posts by this user
Quote this message in a reply
11-06-2012, 05:52 PM (This post was last modified: 11-06-2012 06:28 PM by cliverlong.)
Post: #8
RE: x-start or x-finish for 2D graph as a variable?
Hello Simon,

The link to the video isn't in your previous post.

I have probably misunderstood your description but the attached screen print is my interpretation of your instructions. I selected the point on the y-axis and a point I placed at the origin. I then selected the "straight line" option which the Autograph help file for two points selected says should give the length of the line segment between the two points. However, when I select "straight line" option the dialog box only allows me to define the vector form of a straight line, rather than the length of a segment between two points.

Regards,

Clive
Hello Simon

Method 2

That presentation is what I want. My idea is to show the area changes as the horizontal length changes and that there is a maximum value - and empirically one can work back to the value of a. With the addition of a textbox showing the area below the rectangle it looks clear. Then I can follow up with the calculus method to show that also gives a value of a= 5. Is it possible to "get" at the value for the area and plot that on the vertical axis against the value of a on the horizontal axis so the maximum of the parabola is quite clear?

However, I find when I set a = 5, the area becomes "invalid". The area is ok for a=4.9 and a = 5.1.

Can you briefly explain why the area calculation needs x value in the the range -1 to 11?

Thanks

Clive


Attached File(s)
.pdf  minmax.pdf (Size: 11.99 KB / Downloads: 3)
.pdf  agminimax screen prints.pdf (Size: 210.81 KB / Downloads: 3)
Find all posts by this user
Quote this message in a reply
12-06-2012, 08:22 AM
Post: #9
RE: x-start or x-finish for 2D graph as a variable?
Hi Clive,

Oops, the video answers a few of the questions in your reply: http://screencast.com/t/2TTeo6ZU

Method 1

You want the Line Segment option not the Straight Line option. When you select a Line Segment and create a Text Box the length of the line segment is displayed.

Method 2

The only way to get at the value for the area is to create a function that represents the calculation (i.e. y = 10(10 - x) where y is the area and x the length of one side). If you prefer you can change the variables used on the axes by going to Edit Axes > Labels.

You have spotted the issue with this method, the occasional invalid area. This is when the end of one of our 1000 area rectangles coincides with one of the steps in the function. The function which is used to create the step contains a divide by (x - a) which is undefined when x = a. If the end of one of our 1000 area rectangles coincides with this point Autograph will not be able to calculate the area of that rectangle, so the total area is invalid.

The area calculation needs to be wide enough to cover all the possible rectangles that you can create by changing the value of a. So really it just needs to be 0 to 10. You might be able to avoid invalid areas by using -0.001 to 10.001. That way it is less likely one of the ends of the area rectangles coincides with the step in the function.

Hope that helps,

Simon
Visit this user's website Find all posts by this user
Quote this message in a reply
13-06-2012, 10:21 AM (This post was last modified: 13-06-2012 10:23 AM by cliverlong.)
Post: #10
RE: x-start or x-finish for 2D graph as a variable?
Hello Simon,

I have combined both methods into one .agg file.

The rectangle is drawn using the two step functions. The area has been calculated by fiddling with the limits to try and avoid a division by zero at one of the boundaries. I haven't done that systematically and it might still fail for a particular value for "a" but at least the area estimation works.

Next I used your method to plot the parabola. The only changes I made was instead of using the horizontal line to get the height on the y-axis, I defined the coordinates of two points at (a,0) and (a,a(10-a)). Rather than plotting the whole curve I turned trace on the point (a, a(10-a)) so as the value of the constant a is changed the parabola is "revealed" rather than shown "all at once". The idea is the students can see what shape is emerging as the value of "a" changes by small increments. I then defined a line segment between these two points and made the line segment quite faint , the idea being its role is just to locate the point (a, a(10-a)). Finally I selected the line segment and put a text box next to it, changing the text from "length" to "area". The overall effect is as "a" is gradually changed the area value changes and the students can predict

(i) there will be a maximum area

(ii) for which value of x that maximum area will occur

(iii) what the maximum value of the area will be

then confirm the predictions by making a = 5

and (iv) try to explain why the curve is a parabola i.e. recognise we are plotting Area against x and this represents the graph of y = x(10-x) which expands to an (upside down) parabola

Clive

.agg  C3 minimax area using step function.agg (Size: 12.88 KB / Downloads: 1)
The "draw" of the rectangle and then "hide" the points is a lot easier to handle than manipulating the "step" function - although the "step function" is a very useful tool for restricting the domain.

Clive
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)