Bruce Willis writes.
> I'm still not sure what you are trying to do, but maybe something like the
following will help you get started:
> (%i21) depends(y,[x,d])$
>(%i22) x^2+d*y*4+d^2*(-4)$
> (%i23) first(solve(x^2+d*y*4+d^2*(-4),y));
> (%o23) y=-(x^2-4*d^2)/(4*d)
> (%i24) map(lambda([s], at(s, [x=50, d=25])),[diff(%,x), diff(%,d)]);
> (%o24) [at('diff(y,x,1),[x=50,d=25])=-1,at('diff(y,d,1),[x=50,d=25])=2]
>Maybe more simple:
> (%i1) x^2+d*y*4+d^2*(-4)$
> (%i2) rhs(first(solve(x^2+d*y*4+d^2*(-4),y)));
> (%o2) -(x^2-4*d^2)/(4*d)
> (%i3) subst([x=50, d=25],[diff(%,x), diff(%,d)]);
> (%o3) [-1,2]
The expression x^2+d*y*4+d^2*(-4) is a parabola on the x and y axis with d
being the distance from the vertex to the focal point, which is parallel to
the y axis with the focal point at x=0, y=0; similar to a crown on a road.
Now what is being sought is to vary x and d which will give a y value. What
we are seeking is the derivative at each of the plus x and minus x values
with a d value defined.
If we do manual calculations as an example we have.
y=-(x^2-4*d^2)/(4*d)
and for x = 50, d=50, then y=37.5
solving for dy/dx or [0=x/(2d)] and plugging in numbers we get
50/2*50= 0.50 for x=10 and
-50/2*50 = -0.50 for x=-10
Now if we run a series of sample x & d values then.
x= d= y= lhs(dy/dx) rhs(dy/dx)
10 5 0.00 1.00 -1.00
10 10 7.50 0.50 -0.50
50 25 0.00 1.00 -1.00
50 50 37.50 0.50 -0.50
100 50 0.00 1.00 -1.00
100 100 75.00 0.50 -0.50
Now what we want is to plug values for x and d such that we wind up with
dy/dx values at -x and +x.
The expressions given by Baron as.
(%i21) depends(y,[x,d])$
(%i22) x^2+d*y*4+d^2*(-4)$
(%i23) first(solve(x^2+d*y*4+d^2*(-4),y));
(%o23) y=-(x^2-4*d^2)/(4*d)
(%i24) map(lambda([s], at(s, [x=50, d=25])),[diff(%,x), diff(%,d)]);
(%o24) [at('diff(y,x,1),[x=50,d=25])=-1,at('diff(y,d,1),[x=50,d=25])=2]
is as an excellent starting point because it reduces a number of unnecessary
steps. However (%i24) is in error as we are not looking for diff(%,d) but
something like lhs(diff(%,x), rhs(diff(%,x)).
But trying .
map(lambda([s], at(s, [x=50, d=25])),[lhs(diff(%,x)), rhs(diff(%,x))]);
does not work, it gives me [[1 = 0, 1 = 0], 0].
I have tried many variations of this and other functions and cannot wind up
with numbers as shown in the table above.
Any feedback would be appreciated.
William Porter
wporter at omegapar.com