cnheying

20 Reputation

3 Badges

11 years, 85 days

MaplePrimes Activity


These are questions asked by cnheying

assuming a equations likes this:

tan(x)+y*sin(x)=1;

tan(x)-y*sin(x)=0;

I want to solve this equations using LinearSolve function(do not use solve()). I  fisrtly change tan(x)=u,y*sin(x)=v and then solve u,v using LinearSolve. finally, I obtain x=atan(u), y=v/sin(x).

the question is how can I perform the above operates neatly? I know I can achive this by using a lot of subs().but is there any tools in maple do this neatly just like IntegrationTools[Change]?

my codes list below.note the last line of the codes.evalf is not effective? the output is a long expression. how to force the maple to evaluate the long expression into a numeric value?

--------------------codes---------------------

restart:
 with(Tolerances):
 ALL := [`$`(1 .. 3)]:
 solution_k := simplify(solve(map(proc (i) options operator, arrow:
 1/k[i] = (cos(Phi)*(x[i]-Tx)+sin(Phi)*(y[i]-Ty))/(-sin(Phi)*(x[i]-Tx)+cos(Phi)*(y[i]-Ty)) end proc, ALL), [Tx, Ty, Phi]), size):
 assign(solution_k):
 k := map(proc (i) options operator, arrow:
 tan(phi[i]) end proc, ALL):
 deg2rad := Tolerances:-`*`(Pi, Tolerances:-`^`(180, Tolerances:-`-`(1))):
 phi0[1] := Tolerances:-`*`(Pi, Tolerances:-`^`(3, Tolerances:-`-`(1))):
 phi0[2] := Pi:
 phi0[3] := Tolerances:-`-`(Tolerances:-`*`(Pi, Tolerances:-`^`(3, Tolerances:-`-`(1)))):
 alpha := Tolerances:-`*`(Pi, Tolerances:-`^`(10, Tolerances:-`-`(1))):
 L := 1:
 phi := phi0:
 x := map(proc (i) options operator, arrow:
 cos(phi0[i]+alpha)*L end proc, ALL):
 y := map(proc (i) options operator, arrow:
 sin(phi0[i]+alpha)*L end proc, ALL):
 angleError := Tolerances:-`&+-`(0, Tolerances:-`^`(10, -4)):
 locError := Tolerances:-`&+-`(0, Tolerances:-`^`(10, -4)):
 phi := map(proc (i) options operator, arrow:
 phi[i]+angleError end proc, ALL):
 x := map(proc (i) options operator, arrow:
 x[i]+locError end proc, ALL):
 y := map(proc (i) options operator, arrow:
 y[i]+locError end proc, ALL):
 evalf(Phi)

-----------------------------outputs--------------------

 

Page 1 of 1