Kitonum

13579 Reputation

24 Badges

11 years, 124 days

MaplePrimes Activity


These are answers submitted by Kitonum

If I understand the question correctly, then here is the solution (x(t)  is a vector-function  x(t)=<x1(t),x2(t)>):

restart;
A:=<1,2; 3,4>;
ODE:=Equate(diff(<x1(t),x2(t)>, t),A.<x1(t),x2(t)>);
dsolve({ODE[],x1(0)=0,x2(0)=1});

               

Here is a visalization of Joachimsthal's theorem using the ellipse  x^2/5^2+y^2/3^2=1  as an example. I took the point  P0=[1,1]  inside the ellipse and found 4 normals to the ellipse passing through this point (P0A, P0B, P0C, P0E  in the pic.). The point  E1  is diametrically opposite the point  E . I found the equation of the circle passing through points  A, B, C. We see in the pic. that this circle also passes through the point E1.

  
 

restart;
Ellipse:=plots:-implicitplot(x^2/5^2+y^2/3^2=1, x=-6..6,y=-6..6, color=blue):
P0:=[1,1]:
Sys:={x^2/5^2+y^2/3^2=1, (x-P0[1])*(y/3^2)-(x/5^2)*(y-P0[2])};
Sol:=[solve(Sys,explicit)]:
L:=map(t->eval([x,y],t),simplify(fnormal~(evalf(Sol),9), zero));
Points:=plots:-pointplot([L[],-L[2],P0], symbol=solidcircle, color=[red$5,green], symbolsize=15):
a:=L[1]: b:=L[3]: c:=L[4]: e:=L[2]: e1:=-e:
P0A:=plot([P0,a], color=green):
P0B:=plot([P0,b], color=green):
P0C:=plot([P0,c], color=green):
P0E:=plot([P0,e], color=green):
geometry:-circle(cc,[geometry:-point(A,a),geometry:-point(B,b),geometry:-point(C,c)]):
Eq:=geometry:-Equation(cc, [x,y]);
Circle:=plots:-implicitplot(Eq, x=-2..7, y=-4..4, color=red):
T:=plots:-textplot([[P0[],"P0"],[a[],A],[b[],B],[c[],C],[e[],E],[e1[],E1]],font=[times,18], align={below,right}):

plots:-display(Ellipse,Points, Circle, P0A, P0B, P0C, P0E, T, view=[-5.7..5.7,-3.7..3.7], scaling=constrained, size=[800,500]);

{(1/9)*(x-1)*y-(1/25)*x*(y-1), (1/25)*x^2+(1/9)*y^2 = 1}

 

[[1.30833205, 2.89547512], [-4.94896878, -.427521813], [4.80303934, -.833722213], [1.96259737, -2.75923109]]

 

-3.948442606+x^2+y^2-4.167340016*x-.2399612430*y = 0

 

 

 
 

 


Download Joachimsthal.mw

When solving numerically, all parameters must be specified.


 

restart

ode1 := diff(f(eta), `$`(eta, 3))+(diff(f(eta), `$`(eta, 2)))*f(eta)-(diff(f(eta), eta))^2-M*(diff(f(eta), eta))-A*(diff(f(eta), eta)+(1/2)*eta*(diff(f(eta), `$`(eta, 2)))) = 0

diff(diff(diff(f(eta), eta), eta), eta)+(diff(diff(f(eta), eta), eta))*f(eta)-(diff(f(eta), eta))^2-(diff(f(eta), eta)) = 0

(1)

ode2 := diff(theta(eta), `$`(eta, 2))+Pr*(f(eta)*(diff(theta(eta), eta))-(diff(f(eta), eta))*theta(eta)-A*(theta(eta)+(1/2)*eta*(diff(theta(eta), eta)))) = 0

diff(diff(theta(eta), eta), eta)+7*f(eta)*(diff(theta(eta), eta))-7*(diff(f(eta), eta))*theta(eta) = 0

(2)

Pr := 7; M := 1; A := 0; bcs := f(0) = 0, (D(f))(0) = 1, (D(f))(inf) = 0, theta(0) = 1, theta(inf) = 0

sol := dsolve({ode1, ode2, f(0) = 0, theta(0) = 1, theta(3) = 0, (D(f))(0) = 1, (D(f))(3) = 0}, numeric)

proc (x_bvp) local res, data, solnproc, _ndsol, outpoint, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x_bvp) else outpoint := evalf(x_bvp) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(18, {(1) = .0, (2) = .11080390256348639, (3) = .22591844139106548, (4) = .34588964281348056, (5) = .4716523343043259, (6) = .6080709818887069, (7) = .7600144888376885, (8) = .9331124675025984, (9) = 1.1254061717692387, (10) = 1.340712579997116, (11) = 1.5699796896279121, (12) = 1.8077330699474043, (13) = 2.0488154095847557, (14) = 2.2915494979600313, (15) = 2.5347874698936588, (16) = 2.738137142308144, (17) = 2.882246313702448, (18) = 3.0}, datatype = float[8], order = C_order); Y := Matrix(18, 5, {(1, 1) = .0, (1, 2) = 1.0, (1, 3) = -1.4159579312952832, (1, 4) = 1.0, (1, 5) = -2.966721570427869, (2, 1) = .10254790936620359, (2, 2) = .854766138142636, (2, 3) = -1.2108609938844022, (2, 4) = .7119702204189595, (2, 5) = -2.2529443484676825, (3, 1) = .1933386248397818, (3, 2) = .7261141498797105, (3, 3) = -1.0292712167948561, (3, 4) = .48896558594153866, (3, 5) = -1.6439561023334552, (4, 1) = .273445019233398, (4, 2) = .6125153444881043, (4, 3) = -.8690340270440551, (4, 4) = .32285107977526273, (4, 5) = -1.1478776583047943, (5, 1) = .3439929065438903, (5, 2) = .5123623671028084, (5, 3) = -.7278866150546854, (5, 4) = .20401398115921057, (5, 5) = -.763208344331232, (6, 1) = .40752931110225393, (6, 2) = .42201870569082767, (6, 3) = -.6007171044019981, (6, 4) = .12094570617836783, (6, 5) = -.4741731754914774, (7, 1) = .4651864587138374, (7, 2) = .3398323246314554, (7, 3) = -.48523177286065394, (7, 4) = 0.6576752588080015e-1, (7, 5) = -.2692387887187611, (8, 1) = .5172955042540776, (8, 2) = .2652555390343341, (8, 3) = -.3807189466982358, (8, 4) = 0.3190474268417667e-1, (8, 5) = -.13586992168519285, (9, 1) = .5618538011289125, (9, 2) = .20105229288952095, (9, 3) = -.29112510723583646, (9, 4) = 0.13862195042234635e-1, (9, 5) = -0.61068755991753085e-1, (10, 1) = .5990189139949184, (10, 2) = .14686791686626252, (10, 3) = -.21603895947752078, (10, 4) = 0.5293088810986395e-2, (10, 5) = -0.2398684513468548e-1, (11, 1) = .6275651982514946, (11, 2) = .10437407124731421, (11, 3) = -.15784002043588816, (11, 4) = 0.1850360300458294e-2, (11, 5) = -0.8570603055814197e-2, (12, 1) = .6483609430786376, (12, 2) = 0.7226679700792346e-1, (12, 3) = -.11471902808310486, (12, 4) = 0.6091866446731281e-3, (12, 5) = -0.2870227765852086e-2, (13, 1) = .6627748846812015, (13, 2) = 0.4854681847700357e-1, (13, 3) = -0.8387959478183746e-1, (13, 4) = 0.19384398500141045e-3, (13, 5) = -0.9287125684605533e-3, (14, 1) = .6723201351483533, (14, 2) = 0.30975418834191904e-1, (14, 3) = -0.6222095329896541e-1, (14, 4) = 0.59706045590324044e-4, (14, 5) = -0.2944620596708145e-3, (15, 1) = .6781752653451799, (15, 2) = 0.17771295886020957e-1, (15, 3) = -0.4730354171205899e-1, (15, 4) = 0.17267857573074266e-4, (15, 5) = -0.9246320604202312e-4, (16, 1) = .680875777271328, (16, 2) = 0.9081482731198172e-2, (16, 3) = -0.38660056708540926e-1, (16, 4) = 0.5233594843947423e-5, (16, 5) = -0.35019075932068573e-4, (17, 1) = .6817996720972286, (17, 2) = 0.3848564639774088e-2, (17, 3) = -0.3416424691997061e-1, (17, 4) = 0.15849264379686802e-5, (17, 5) = -0.17594629399520723e-4, (18, 1) = .6820229739725837, (18, 2) = .0, (18, 3) = -0.3131585750462712e-1, (18, 4) = .0, (18, 5) = -0.10027297369571506e-4}, datatype = float[8], order = C_order); YP := Matrix(18, 5, {(1, 1) = 1.0, (1, 2) = -1.4159579312952832, (1, 3) = 2.0, (1, 4) = -2.966721570427869, (1, 5) = 7.0, (2, 1) = .854766138142636, (2, 2) = -1.2108609938844022, (2, 3) = 1.709562552513841, (2, 4) = -2.2529443484676825, (2, 5) = 5.877219380436879, (3, 1) = .7261141498797105, (3, 2) = -1.0292712167948561, (3, 3) = 1.4523537901775314, (3, 4) = -1.6439561023334552, (3, 5) = 4.710195300149449, (4, 1) = .6125153444881043, (4, 2) = -.8690340270440551, (4, 3) = 1.2253234179610244, (4, 4) = -1.1478776583047943, (4, 5) = 3.581428680897506, (5, 1) = .5123623671028084, (5, 2) = -.7278866150546854, (5, 3) = 1.0252653946730563, (5, 4) = -.763208344331232, (5, 5) = 2.569471400816961, (6, 1) = .42201870569082767, (6, 2) = -.6007171044019981, (6, 3) = .844928321368076, (6, 4) = -.4741731754914774, (6, 5) = 1.7099657255202751, (7, 1) = .3398323246314554, (7, 2) = -.48523177286065394, (7, 3) = .681041583568359, (7, 4) = -.2692387887187611, (7, 5) = 1.033173189144707, (8, 1) = .2652555390343341, (8, 2) = -.3807189466982358, (8, 3) = .5325602395340744, (8, 4) = -.13586992168519285, (8, 5) = .5512346655868281, (9, 1) = .20105229288952095, (9, 2) = -.29112510723583646, (9, 3) = .40504406547017163, (9, 4) = -0.61068755991753085e-1, (9, 5) = .2596911714733248, (10, 1) = .14686791686626252, (10, 2) = -.21603895947752078, (10, 3) = .2978495247577146, (10, 4) = -0.2398684513468548e-1, (10, 5) = .10602171195140898, (11, 1) = .10437407124731421, (11, 2) = -.15784002043588816, (11, 3) = .21432292171292172, (11, 4) = -0.8570603055814197e-2, (11, 5) = 0.39002192905830964e-1, (12, 1) = 0.7226679700792346e-1, (12, 2) = -.11471902808310486, (12, 3) = .15186862419473446, (12, 4) = -0.2870227765852086e-2, (12, 5) = 0.13334772840962163e-1, (13, 1) = 0.4854681847700357e-1, (13, 2) = -0.8387959478183746e-1, (13, 3) = .10649690081988093, (13, 4) = -0.9287125684605533e-3, (13, 5) = 0.4374565119513037e-2, (14, 1) = 0.30975418834191904e-1, (14, 2) = -0.6222095329896541e-1, (14, 3) = 0.7376729513716532e-1, (14, 4) = -0.2944620596708145e-3, (14, 5) = 0.13987553406612672e-2, (15, 1) = 0.17771295886020957e-1, (15, 2) = -0.4730354171205899e-1, (15, 3) = 0.5016720679583185e-1, (15, 4) = -0.9246320604202312e-4, (15, 5) = 0.44109192048924695e-3, (16, 1) = 0.9081482731198172e-2, (16, 2) = -0.38660056708540926e-1, (16, 3) = 0.3548665222057664e-1, (16, 4) = -0.35019075932068573e-4, (16, 5) = 0.16723818542037767e-3, (17, 1) = 0.3848564639774088e-2, (17, 2) = -0.3416424691997061e-1, (17, 3) = 0.2715654843704532e-1, (17, 4) = -0.17594629399520723e-4, (17, 5) = 0.8401478572977908e-4, (18, 1) = .0, (18, 2) = -0.3131585750462712e-1, (18, 3) = 0.21358134267807444e-1, (18, 4) = -0.10027297369571506e-4, (18, 5) = 0.47871930210318376e-4}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(18, {(1) = .0, (2) = .11080390256348639, (3) = .22591844139106548, (4) = .34588964281348056, (5) = .4716523343043259, (6) = .6080709818887069, (7) = .7600144888376885, (8) = .9331124675025984, (9) = 1.1254061717692387, (10) = 1.340712579997116, (11) = 1.5699796896279121, (12) = 1.8077330699474043, (13) = 2.0488154095847557, (14) = 2.2915494979600313, (15) = 2.5347874698936588, (16) = 2.738137142308144, (17) = 2.882246313702448, (18) = 3.0}, datatype = float[8], order = C_order); Y := Matrix(18, 5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = -0.18590626968888025e-10, (1, 4) = .0, (1, 5) = 0.17061446195413568e-7, (2, 1) = -0.8086492453824127e-10, (2, 2) = 0.11239169969361501e-9, (2, 3) = -0.17894382018115469e-9, (2, 4) = -0.2747229862734361e-8, (2, 5) = 0.7452174135251449e-8, (3, 1) = -0.14637762509984906e-9, (3, 2) = 0.2029901127867211e-9, (3, 3) = -0.3084752042344079e-9, (3, 4) = -0.5611682898261589e-8, (3, 5) = 0.3172708709982656e-8, (4, 1) = -0.1991162591875237e-9, (4, 2) = 0.27545279238153786e-9, (4, 3) = -0.41229897600367154e-9, (4, 4) = -0.689782171184356e-8, (4, 5) = 0.1048380090726617e-8, (5, 1) = -0.2429145886361696e-9, (5, 2) = 0.3352274133908414e-9, (5, 3) = -0.4980269979534315e-9, (5, 4) = -0.5566748542036905e-8, (5, 5) = -0.468340954922355e-8, (6, 1) = -0.30239326738681016e-9, (6, 2) = 0.4172029271934021e-9, (6, 3) = -0.614633654217239e-9, (6, 4) = -0.27890080432292874e-9, (6, 5) = -0.21600417944053615e-7, (7, 1) = -0.41217209326336544e-9, (7, 2) = 0.5705970533572843e-9, (7, 3) = -0.8310622495108273e-9, (7, 4) = 0.11494949157187653e-7, (7, 5) = -0.6265982652059931e-7, (8, 1) = -0.6447247402051642e-9, (8, 2) = 0.898470779286956e-9, (8, 3) = -0.12917523407839026e-8, (8, 4) = 0.3212236168399007e-7, (8, 5) = -0.1429155408239229e-6, (9, 1) = -0.9531312017921465e-9, (9, 2) = 0.13350030329748363e-8, (9, 3) = -0.19028846487794993e-8, (9, 4) = 0.41778594194087756e-7, (9, 5) = -0.18708234256718512e-6, (10, 1) = -0.13838420901629499e-8, (10, 2) = 0.19462318572222827e-8, (10, 3) = -0.2756346741189889e-8, (10, 4) = 0.3373261275381019e-7, (10, 5) = -0.15815211597579714e-6, (11, 1) = -0.1563835155835792e-8, (11, 2) = 0.22041431263277762e-8, (11, 3) = -0.3107306227599534e-8, (11, 4) = 0.15327555187430568e-8, (11, 5) = -0.15766659824515895e-7, (12, 1) = -0.14091394759357702e-8, (12, 2) = 0.1988961804499738e-8, (12, 3) = -0.27888452549708894e-8, (12, 4) = -0.14697003645653533e-7, (12, 5) = 0.6134940340948731e-7, (13, 1) = -0.10268402401829339e-8, (13, 2) = 0.14507823030224331e-8, (13, 3) = -0.2015726229432468e-8, (13, 4) = -0.11342594440856882e-7, (13, 5) = 0.48415287223161295e-7, (14, 1) = -0.6085185476324706e-9, (14, 2) = 0.8583867592547979e-9, (14, 3) = -0.1170097949913155e-8, (14, 4) = -0.3888183396942034e-8, (14, 5) = 0.14476556515912115e-7, (15, 1) = -0.2605931357377985e-9, (15, 2) = 0.35950926606495426e-9, (15, 3) = -0.4631322591966298e-9, (15, 4) = 0.9477006846236126e-10, (15, 5) = -0.4153838656000498e-8, (16, 1) = -0.54665210522375424e-10, (16, 2) = 0.6811663399393606e-10, (16, 3) = -0.46257911085063764e-10, (16, 4) = 0.7790327343268495e-9, (16, 5) = -0.7491400328772006e-8, (17, 1) = -0.11211122425853728e-10, (17, 2) = 0.12385662727576435e-10, (17, 3) = 0.41106271841654664e-10, (17, 4) = 0.3698977274849841e-9, (17, 5) = -0.5603842352003619e-8, (18, 1) = 0.21268663471074856e-11, (18, 2) = .0, (18, 3) = 0.6647521101845436e-10, (18, 4) = .0, (18, 5) = -0.387292652011095e-8}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[18] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.8708234256718512e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [5, 18, [f(eta), diff(f(eta), eta), diff(diff(f(eta), eta), eta), theta(eta), diff(theta(eta), eta)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[18] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[18] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(5, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(18, 5, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(5, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(18, 5, X, Y, outpoint, yout, L, V) end if; [eta = outpoint, seq('[f(eta), diff(f(eta), eta), diff(diff(f(eta), eta), eta), theta(eta), diff(theta(eta), eta)]'[i] = yout[i], i = 1 .. 5)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[18] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.8708234256718512e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [5, 18, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[18] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[18] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(18, 5, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(5, {(1) = 0., (2) = 0., (3) = 0., (4) = 0., (5) = 0.}); `dsolve/numeric/hermite`(18, 5, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 5)] end proc, (2) = Array(0..0, {}), (3) = [eta, f(eta), diff(f(eta), eta), diff(diff(f(eta), eta), eta), theta(eta), diff(theta(eta), eta)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x_bvp) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x_bvp) else _ndsol := pointto(data[2][0]); return ('_ndsol')(x_bvp) end if end if; try res := solnproc(outpoint); [eta = res[1], seq('[f(eta), diff(f(eta), eta), diff(diff(f(eta), eta), eta), theta(eta), diff(theta(eta), eta)]'[i] = res[i+1], i = 1 .. 5)] catch: error  end try end proc

(3)

plots:-odeplot(sol, [[eta, f(eta)], [eta, theta(eta)]], eta = 0 .. 3, color = [red, blue])

 

 


 

Download dsolve_new.mw

See help on the  intsolve  command. Help quote: "When the solution contains integrals, they are represented with the inert Int." You can try to calculate these integrals by any methods, for example by  evalf(Int(...), method=...) .

Use the normal command which is not in the "prohibited" list of commands or just solve by hand (without Maple):

normal(-1/(y-1)-y/(y-1)-y^2-2*y-1+y^3/(y-1)+y^2/(y-1));
                                             
0

1. Use the  Number Theory package instead of deprecated numtheory one.

2. lambda becomes protected only after calling  Number Theory package, because this is the name of the built-in function from this package. You can use  unprotect command to remove this protection (but then you cannot use this function):

restart;
with(NumberTheory):
lambda:=5;
unprotect(lambda);
lambda:=5;
lambda;


If you want to work with this package and use the symbol  lambda  at the same time, it is better not to call the whole package, but only the command from the package that you need:

restart;
NumberTheory:-lambda(100);
lambda:=5;
lambda;

 

You have some pretty complicated code. Here is a simple recursive procedure that returns all the fractions obtained in the nth step:

T:=proc(n)
local P;
option remember;
P:=proc(p)
local p1, p2;
p1:=numer(p); p2:=denom(p);
p1/(p1+p2), (p1+p2)/p2;
end proc;
if n=1 then return [1] else
[seq(P(T(n-1)[i]), i=1..nops(T(n-1)))] fi;
end proc:

Examples of use:
T(4);
sort(T(4));
sort([seq(T(i)[],i=1..4)]);
  # Sorted list of all the fractions obtained in the first 4 steps 
                             


Addition. Similarly, we can write a procedure using the formula from wiki  q[i+1]=1/(2*floor(q[i])-q[i]+1) :

T1:=proc(n)
option remember;
if n=1 then return 1 else
1/(2*floor(T1(n-1))-T1(n-1)+1) fi;
end proc:

sort([seq(T1(n), n=1..100)]);

 

I rewrote the original code, simplifying it a bit. We can reduce the number of unknowns by 2 times if we write  C1 := <cos(s), sin(s))> , C2 := <cos(t), sin(t)> . Then the conditions  eq1  and  eq2  are satisfied automatically. We get that the vectors  C1  and  C2  either coincide or differ from each other by turning by an angle multiple of  90  degrees.
 

``

restart; with(LinearAlgebra)

C1 := `<,>`(cos(s), sin(s)); C2 := `<,>`(cos(t), sin(t)); A := C1.C1^%T; B := C2.C2^%T; D1 := A.B; D2 := B.A

Vector(2, {(1) = cos(s), (2) = sin(s)})

 

Vector(2, {(1) = cos(t), (2) = sin(t)})

 

Matrix(2, 2, {(1, 1) = cos(s)^2, (1, 2) = cos(s)*sin(s), (2, 1) = cos(s)*sin(s), (2, 2) = sin(s)^2})

 

Matrix(2, 2, {(1, 1) = cos(t)^2, (1, 2) = cos(t)*sin(t), (2, 1) = cos(t)*sin(t), (2, 2) = sin(t)^2})

 

Matrix(2, 2, {(1, 1) = cos(s)^2*cos(t)^2+cos(s)*sin(s)*cos(t)*sin(t), (1, 2) = cos(s)^2*cos(t)*sin(t)+cos(s)*sin(s)*sin(t)^2, (2, 1) = cos(s)*sin(s)*cos(t)^2+sin(s)^2*cos(t)*sin(t), (2, 2) = cos(s)*sin(s)*cos(t)*sin(t)+sin(s)^2*sin(t)^2})

 

Matrix(%id = 18446746338043240566)

(1)

eqns:=Equate(D1,D2);
solve(eqns, allsolutions);
about(_Z1);

[cos(s)^2*cos(t)^2+cos(s)*sin(s)*cos(t)*sin(t) = cos(s)^2*cos(t)^2+cos(s)*sin(s)*cos(t)*sin(t), cos(s)^2*cos(t)*sin(t)+cos(s)*sin(s)*sin(t)^2 = cos(s)*sin(s)*cos(t)^2+sin(s)^2*cos(t)*sin(t), cos(s)*sin(s)*cos(t)^2+sin(s)^2*cos(t)*sin(t) = cos(s)^2*cos(t)*sin(t)+cos(s)*sin(s)*sin(t)^2, cos(s)*sin(s)*cos(t)*sin(t)+sin(s)^2*sin(t)^2 = cos(s)*sin(s)*cos(t)*sin(t)+sin(s)^2*sin(t)^2]

 

{s = s, t = Pi*_Z1+s}, {s = s, t = -(1/2)*Pi+s+Pi*_Z1}

 

Originally _Z1, renamed _Z1~:
  is assumed to be: integer

 

``


Edit.

Download Sol_edit.mw

I converted your 2D math input code to 1D code and replaced  `a__10 `  with a__10  and so on. Now everything works properly:
 

a__10 := (1-u__2)*(u__2-m)-q*(u__2+c)+u__2*(1+m-2*u__2);

(1-u__2)*(u__2-m)-q*(u__2+c)+u__2*(1+m-2*u__2)

(1)

a__01 := -u__2*q;

-u__2*q

(2)

a__20 := 1/2*(-6*u__2+2*m+2);

-3*u__2+m+1

(3)

a__11 := -q;

-q

(4)

a__02 := 0;

0

(5)

b__10 := s;

s

(6)

b__01 := -s;

-s

(7)

b__20 := -s/(u__2+c);

-s/(u__2+c)

(8)

b__11 := 2*s/(u__2+c);

2*s/(u__2+c)

(9)

b__02 := -s/(u__2+c);

-s/(u__2+c)

(10)

b__03 := 0;

0

(11)

a__30 := -1;

-1

(12)

a__21 := 0;

0

(13)

b__12 := s/(u__2+c)^2;

s/(u__2+c)^2

(14)

a__12 := 0;

0

(15)

b__21 := (-2*(u__2+c)^2-s)/(2*(u__2+c)^3);

(1/2)*(-2*(u__2+c)^2-s)/(u__2+c)^3

(16)

l__1 := ((-3*Pi)*(1/(2*a__01*(q*s*u__2-s^2))))*(a__10*b__10*(a__02*b__11+a__11^2+a__11*b__02)+a__10*a__01*(a__11*b__02+a__20*b__11+b__11^2)+b__10^2*(a__02*a__11+2*a__02*b__02)-2*a__10*b__10*(-a__02*a__20+b__02^2)-2*a__10*a__01*(a__20^2-b__02*b__20)-a__01^2*(2*a__20*b__20+b__11*b__20)+(a__01*b__10-2*a__10^2)*(-a__11*a__20+b__02*b__11)-(a__01*b__10+a__10^2)*(3*(-a__01*a__30+b__03*b__10)+2*a__10*(a__21+b__12)+b__10*a__12-a__01*b__21));

(3/2)*Pi*(((1-u__2)*(u__2-m)-q*(u__2+c)+u__2*(1+m-2*u__2))*s*(q^2+q*s/(u__2+c))-((1-u__2)*(u__2-m)-q*(u__2+c)+u__2*(1+m-2*u__2))*u__2*q*(q*s/(u__2+c)+2*(-3*u__2+m+1)*s/(u__2+c)+4*s^2/(u__2+c)^2)-2*((1-u__2)*(u__2-m)-q*(u__2+c)+u__2*(1+m-2*u__2))*s^3/(u__2+c)^2+2*((1-u__2)*(u__2-m)-q*(u__2+c)+u__2*(1+m-2*u__2))*u__2*q*((-3*u__2+m+1)^2-s^2/(u__2+c)^2)-u__2^2*q^2*(-2*(-3*u__2+m+1)*s/(u__2+c)-2*s^2/(u__2+c)^2)+(-q*s*u__2-2*((1-u__2)*(u__2-m)-q*(u__2+c)+u__2*(1+m-2*u__2))^2)*(q*(-3*u__2+m+1)-2*s^2/(u__2+c)^2)-(-q*s*u__2+((1-u__2)*(u__2-m)-q*(u__2+c)+u__2*(1+m-2*u__2))^2)*(-3*u__2*q+2*((1-u__2)*(u__2-m)-q*(u__2+c)+u__2*(1+m-2*u__2))*s/(u__2+c)^2+(1/2)*u__2*q*(-2*(u__2+c)^2-s)/(u__2+c)^3))/(u__2*q*(q*s*u__2-s^2))

(17)

 



I advise you to immediately write code in 1D math input. It will be faster and much easier to track possible errors, as all characters are clearly visible.

 

Download coeff_new.mw

 

The syntax for this is  log[2](6) . Maple automatically translates this into the natural logarithm (with base e). For numerical calculation use the  evalf  command:

log[2](6);
evalf(%);

 

Here is another method that immediately provides expansions for  cos(6*t)  and  sin(6*t) . If you need to check it manually, then equate the results from the application of de Moivre's formula and Newton binomial:

evalc((cos(t)+I*sin(t))^6);
Re(%) assuming real;

 

Look at this question and the answer to it.

This is a well-known bug in some versions of Maple <= 2018. As a workaround, besides the depthlimit option, you need to increase  Digits :

restart;
kernelopts(version);
Digits:=20:
Optimization:-LPSolve(4*x1+5*x2+5*x3+2*x4,
                      {33*x1 + 49*x2 + 51*x3 + 22*x4 <= 120},
                      maximize, assume ={nonnegint}, depthlimit=10);

        Maple 2018.2, X86 64 WINDOWS, Oct 23 2018, Build ID 1356656             
                            [13, [x1 = 2, x2 = 1, x3 = 0, x4 = 0]]

 

It works:

Mat:=module()
    description "My Package";
    option package;
    uses Statistics;
    export LinModel; 
    LinModel :=proc(xliste::list, yliste::list,x::algebraic, $)
        return Fit(a*x+b,xliste,yliste,x)
        end proc; # LinModel 

    end module; #Mat

xliste:=[1,2,3]: yliste:=[2,4,5]:
Mat:-LinModel(xliste,yliste, x);

 

Only numerically:

f:=x->x^5 + 2*x^3:
g:=y->fsolve(y = x^5 + 2*x^3, x);  # This is the inverse function for f


Examples of use:

g(1);
plot([f, g], -3..3, -3..3, color=[red,blue], scaling=constrained);
evalf(Int(g, 0..2));
D(g)(2);

                                    

                                                                           

 

1 2 3 4 5 6 7 Last Page 1 of 212