How to transformate the value of solve to the others equation?
Subject: How to transformate the value of solve to the others equation?
From: 黃 裕雄
Date: Wed, 11 Nov 2009 22:14:38 +0800
Dear All
1. How to transformate value of solve to the others equation?
eq1 and eq2 is group (1)
eq3 and eq4 is group (2)
eq1:x-6y=1 eq3:x+y=-6
eq2:ax-by=1 eq4:ax+by=-1
they have the some solution. Solving the a=?, b=?
We have transformate the solution of (eq1 and eq3) into
(eq2 and eq4) can solve a=?, b=?
How can I transformate x,y (don't reassign [x,y]:[5,-1])
into (eq2 and eq4) directly and solve a,b?
========code==================
kill(all);
powerdisp:true;
eq1:x-6*y=1;
eq2:a*x-b*y=1;
eq3:x+y=-6;
eq4:a*x+b*y=-1;
tmp:solve([eq1,eq3]);
tmp[1][1];
tmp[1][2];
/*[x,y]:[-5,-1];*/ /* reassign x=5,y=-1 , for later use */
eq2(x,y):=a*x-b*y=1;
eq2(x,y);
eq4(x,y):=a*x+b*y=-1;
eq4(x,y);
solve([eq2(x,y),eq4(x,y)]);
===============================
=====running=======
.....
(%i6) tmp:solve([eq1,eq3])
(%o6) [[y=-1,x=-5]]
(%i7) (tmp[1])[1]
(%o7) y=-1
(%i8) (tmp[1])[2]
(%o8) x=-5
(%i9) eq2(x,y):=a*x-b*y=1
(%o9) eq2(x,y):=a*x-b*y=1
(%i10) eq2(x,y)(%o10) a*x-b*y=1
(%i11) eq4(x,y):=a*x+b*y=-1
(%o11) eq4(x,y):=a*x+b*y=-1
(%i12) eq4(x,y)
(%o12) a*x+b*y=-1
(%i13) solve([eq2(x,y),eq4(x,y)])
More unknowns than equations - `solve'
Unknowns given : [y,b,x,a]
Equations given: [a*x-b*y=1,a*x+b*y=-1] -- an error.
To debug this try debugmode(true);
2. How to reassign one of col of maxtrix?
we have d is a constant item,
we want to change the some col of D,
such that col(D,1)=d, Dx=D.
col(D,2)=d, Dy=D.
col(D,3)=d, Dz=D.
How can I to do?
========= code =======================
r1:[2,-1,1,0];
r2:[1,a,2,2];
r3:[1,2,b,-2];
for i:1 thru 4 do (c[i]:[r1[i],r2[i],r3[i]]);
d:transpose(matrix(c[4]));
tmp:matrix(c[1],c[2],c[3]);
D:transpose(tmp);
col(D,2):d;
Dx:D;
==================================
======= error message ==============
(%i20) col(D,2):d
Improper value assignment:col(D,2) -- an error.
To debug this try debugmode(true);
_________________________________________________________________
Windows Live?G???z?V?n???q???z?b?????W?????s???V?C
http://www.microsoft.com/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:zh-tw:SI_SB_1:092009