Solve for diff(e2, x, 1) after x and d have been reassigned new values after e4 at e5.



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

-----Original Message-----
From: Barton Willis [mailto:willisb at unk.edu] 
Sent: Thursday, August 05, 2010 4:01 PM
To: William Porter
Cc: maxima at math.utexas.edu
Subject: Re: [Maxima] Solve for diff(e2, x, 1) after x and d have been
reassigned new values after e4 at e5.

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]

--Barton

-----maxima-bounces at math.utexas.edu wrote: -----


>To?start?over?again?the?issue?is?to?Solve?for?
>diff(e2,x,1)
>
>after?
>x
>?and?
>d
>?have?been?reassigned?new?values?after?
>e4?at?e5
>.
>
>
>
>?
>
>
>(%i1)?e1:?x^2+d*y*4+d^2*(-4);
>
>
>
>???????????????????????????????????????????
>2??????2
>
>
>
>(%o1)?????????????????????????
>4?d?y?+?x??-?4?d
>
>
>
>(%i2)?e2:?solve(e1,?y);
>
>
>
>???????????????????????????????????????????????
>2??????2
>
>
>
>?????????????????????????????
>????????????????x?
>-?4?d
>
>
>
>(%o2)?????????????????????????
>[y?=?-?---------]
>
>
>
>????????????????????????????????????????????????
>4?d
>
>
>
>(%i3)?e3:?subst([y=0,?d=5],?e1);
>
>
>
>?????????????????????????????????????????
>2
>
>
>
>(%o3)?????????????????????????????
>x??-?100
>
>
>
>(%i4)?e4:?solve(e3,?x);
>
>
>
>(%o4)????????????????????????
>[x?=?-?10,?x?=?10]
>
>
>
>(%i5)?e5:?subst([x=50,?d=25],?e2);
>
>
>
>(%o5)??????????????????????????????
>[y?=?0]
>
>
>
>?
>
>
>So?at?this?point?x=-10?and?10?when
>y=0…
>
>
>
>Now?e4?has?been?reassigned?new
>values?at?e5,?x=50?and?d=50.?If?I?write?e6:?solve(e5,x);?which?gives?me
>[].?Now
>when?I?continue?to?solve?and?assign?as?follows…
>
>
>
>?
>
>
>(%i6)?e6:?solve(e5,x);
>
>
>
>(%o6)???????????????????????????????
>[]
>
>
>
>(%i7)?e7:?diff(e2,x,1);
>
>
>
>????????????????????????????????????????????????
>x
>
>
>
>(%o7)???????????????????????????
>[0?=?-?---]
>
>
>
>??????????????????????????????????????????????
>2?d
>
>
>
>(%i8)?%phi[1]?:?e7;
>
>
>
>????????????????????????????????????????????????
>x
>
>
>
>(%o8)???????????????????????????
>[0?=?-?---]
>
>
>
>??????????????????????????????????????????????
>2?d
>
>
>
>(%i9)?%phi[2]?:?e7;
>
>
>
>?????????
>???????????????????????????????????????x
>
>
>
>(%o9)???????????????????????????
>[0?=?-?---]
>
>
>
>??????????????????????????????????????????????
>2?d
>
>
>
>Now?when?I?execute…
>
>
>
>(%i10)?subst([e6[1],
>d=25],%phi[1]);?
>
>
>
>(%i11)?subst([e6[2],
>d=25],%phi[2]);
>
>
>
>I?get?“Improper?index?to?list
>or?matrix?–?an?error.
>
>
>
>?
>
>
>The?values?I?should?have?for?(%i10)
>and?(%i11)?should?be?1.0?and?-1.0.?The?purpose?of?this?set?of?expressions
>is?to
>be?able?to?reassign?values?to?
>x
>?and?
>d
>?and?wind?up?with?the
>derivative?values?of?(%i2).
>
>
>
>?
>
>
>William?Porter
>
>
>
>wporter at omegapar.com
>
>
>
>
>
>?
>
>__________?Information?from?ESET?NOD32?Antivirus,?version?of?virus
>signature?database?5341?(20100804)?__________
>
>The?message?was?checked?by?ESET?NOD32?Antivirus.
>
>http://www.eset.com
>?_______________________________________________
>Maxima?mailing?list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima=
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5347 (20100806) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5348 (20100806) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com