Bonjour,
Bonjour à tous,
J'ai développé un algorithme sous Maple pour étudier le mouvement des quilles et de la boule d'une partie de Bowling.
Malheureusement, je n'arrive pas à dire à Maple ce que je veux et je reste bloqué.
En effet, dans la partie des équations, la fonction solve ne résout rien vu que les expressions ne se remplacent pas par leur valeur respective, je ne comprends pas pourquoi.
J'espère que parmi vous, certains apporteront des réponses à mon problème.
Cordialement,
Hyprium
Code:> restart; with(linalg): with(LinearAlgebra): Warning, the protected names norm and trace have been redefined and unprotected Warning, the assigned name GramSchmidt now has a global binding > Bowling:=proc(lambda) local M: v[x]:=(n,i)->v[n,i,x]: v[y]:=(n,i)->v[n,i,y]: p[x]:=(n,i)->p[n,i,x]: p[y]:=(n,i)->p[n,i,y]: v:=(n,i)->sqrt(v[x](n,i)^2+v[y](n,i)^2): e:=(n,k,l)-><(-v[x](n,k)+v[x](n,l))*tchoc+p[x](n,k)+p[x](n,l),(-v[y](n,k)+v[y](n,l))*tchoc+p[y](n,k)+p[y](n,l),0>: f:=(n,k)-><v[x](n,k),v[y](n,k),0>: eq1:=(n,i,j)->v[x](n,i)+v[x](n,j)-v[x](n+1,i)-v[x](n+1,j): eq2:=(n,i,j)->v[y](n,i)+v[y](n,j)-v[y](n+1,i)-v[y](n+1,j): eq3:=(n,i,j)->v(n,i)^2+v(n,j)^2-v(n+1,i)^2-v(n+1,j)^2: eq4:=(n,i,j)->DotProduct(CrossProduct(-e(n,i,j)/2,f(n,i))+CrossProduct(e(n,i,j)/2,f(n,j))-CrossProduct(-e(n,i,j)/2,f(n+1,i))-CrossProduct(e(n,i,j)/2,f(n+1,j)),<0,0,1>): eq5:=(n,i)->M*v[x](n,0)+m*v[x](n,i)-M*v[x](n+1,0)-m*v[x](n+1,i): eq6:=(n,i)->M*v[y](n,0)+m*v[y](n,i)-M*v[y](n+1,0)-m*v[y](n+1,i): eq7:=(n,i)->M*v(n,0)^2+m*v(n,i)^2-M*v(n+1,0)^2-m*v(n+1,i)^2: eq8:=(n,i)->DotProduct(M*CrossProduct(-e(n,0,i)*m/(M+m),f(n,0))+m*CrossProduct(M*(M+m)*e(n,0,i)/2,f(n,i))-M*CrossProduct(-m/(M+m)*e(n,0,i)/2,f(n+1,0))-m*CrossProduct(M*(M+m)*e(n,0,i)/2,f(n+1,i)),<0,0,1>): for z from 0 to 100 do theta:=lambda*(1-z/100): n:=0: M:=4.5359237: m:=1.530: v[b0]:=20/3.6: alpha:=3.14159265359/6: d:=0.3040: r:=0.0575: R:=0.11: p[x](0,0):=(r+R)*sin(theta): p[y](0,0):=-(r+R)*cos(theta): p[x](0,1):=0: p[y](0,1):=0: p[x](0,2):=-d*sin(alpha): p[y](0,2):=d*cos(alpha): p[x](0,3):=d*sin(alpha): p[y](0,3):=d*cos(alpha): p[x](0,4):=-2*d*sin(alpha): p[y](0,4):=2*d*cos(alpha): p[x](0,5):=0: p[y](0,5):=2*d*cos(alpha): p[x](0,6):=2*d*sin(alpha): p[y](0,6):=2*d*cos(alpha): p[x](0,7):=-3*d*sin(alpha): p[y](0,7):=3*d*cos(alpha): p[x](0,8):=-d*sin(alpha): p[y](0,8):=3*d*cos(alpha): p[x](0,9):=d*sin(alpha): p[y](0,9):=3*d*cos(alpha): p[x](0,10):=3*d*sin(alpha): p[y](0,10):=3*d*cos(alpha): v[x](0,0):=-sin(theta)*(4.154285046*cos(theta)-.3634438432e-16*(13065256851622140924785493990079249*cos(theta)^2-11578741724189361656109004298179249+11578741726320212017212603990079249*sin(theta)^2)^(1/2))+5.555555555*cos(theta)*sin(theta): v[y](0,0):=cos(theta)*(4.154285046*cos(theta)-.3634438432e-16*(13065256851622140924785493990079249*cos(theta)^2-11578741724189361656109004298179249+11578741726320212017212603990079249*sin(theta)^2)^(1/2))+5.555555555*sin(theta)^2: v[x](0,1):=-(4.15428504*cos(theta)+.1077485975e-15*(13065256851622140924785493990079249*cos(theta)^2-11578741724189361656109004298179249+11578741726320212017212603990079249*sin(theta)^2)^(1/2))*sin(theta): v[y](0,1):=4.15428504*cos(theta)+.1077485975e-15*(13065256851622140924785493990079249*cos(theta)^2-11578741724189361656109004298179249+11578741726320212017212603990079249*sin(theta)^2)^(1/2): v[x](0,2):=0: v[y](0,2):=0: v[x](0,3):=0: v[y](0,3):=0: v[x](0,4):=0: v[y](0,4):=0: v[x](0,5):=0: v[y](0,5):=0: v[x](0,6):=0: v[y](0,6):=0: v[x](0,7):=0: v[y](0,7):=0: v[x](0,8):=0: v[y](0,8):=0: v[x](0,9):=0: v[y](0,9):=0: v[x](0,10):=0: v[y](0,10):=0: for i from 1 to 9 do for j from i+1 to 10 do eq:=(i,j)->sqrt(((-v[x](n,i)+v[x](n,j))*t+p[x](n,i)+p[x](n,j))^2+((-v[y](n,i)+v[y](n,j))*t+p[y](n,i)+p[y](n,j))^2)-2*r: s:=(i,j)->solve(eq(i,j),t): if s(i,j)=NULL then v[i,j]:=1000000: fi: if Im(s(i,j)[1])=0 then q1[i,j]:=s(i,j)[1]: q2[i,j]:=s(i,j)[2]: else q1[i,j]:=0: q2[i,j]:=0: fi: u[i,j]:=min(q1[i,j],q2[i,j]): if u[i,j]<>0 then v[i,j]:=u[i,j]: else v[i,j]:=1000000: fi: od: od: for i from 1 to 10 do eq:=i->sqrt(((-v[x](n,0)+v[x](n,i))*t+p[x](n,0)+p[x](n,i))^2+((-v[y](n,0)+v[y](n,i))*t+p[y](n,0)+p[y](n,i))^2)-(r+R): s:=i->solve(eq(i),t): if s(i)=NULL then x[0,i]:=1000000: fi: if Im(s(i)[1])=0 then q3[0,i]:=s(i)[1]: q4[0,i]:=s(i)[2]: else q3[0,i]:=0: q4[0,i]:=0: fi: w[0,i]:=min(q3[0,i],q4[0,i]): if w[0,i]<>0 then x[0,i]:=w[0,i]: else x[0,i]:=1000000: fi: od: a:=min(seq(seq(v[i,j],j=i+1..10),i=1..9),seq(x[0,i],i=1..10)): for i from 1 to 9 do for j from i+1 to 10 do if v[i,j]=a then b:=i: c:=j: fi: od: od: for i from 1 to 10 do if x[0,i]=a then b:=i: c:=0: fi: od: tchoc:=a: u:=n+1: if c<>0 then if b<>1 and c<>10 then for i from 1 to b-1 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: for i from b+1 to c-1 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: for i from c+1 to 10 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: fi: if b=1 and c=10 then for i from b+1 to c-1 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: fi: if b=1 and c<>10 then for i from b+1 to c-1 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: for i from c+1 to 10 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: fi: if b<>1 and c=10 then for i from 1 to b-1 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: for i from b+1 to c-1 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: fi: v[x]:=(u,0)->v[x](u-1,0): v[y]:=(u,0)->v[y](u-1,0): p[x]:=(u,0)->[x](u-1,0)+v[x](u,0)*tchoc: p[y]:=(u,0)->[y](u-1,0)+v[y](u,0)*tchoc: p[x]:=(u,b)->p[x](u,b)+v[x](u-1,b)*tchoc: p[y]:=(u,b)->p[y](u,b)+v[y](u-1,b)*tchoc: p[x]:=(u,c)->p[x](u,c)+v[x](u-1,c)*tchoc: p[y]:=(u,c)->p[y](u,c)+v[y](u-1,c)*tchoc: solve({eq1(u-1,b,c),eq2(u-1,b,c),eq3(u-1,b,c),eq4(u-1,b,c)},{v[x](u,b),v[y](u,b),v[x](u,c),v[y](u,c)}): assign(%): else if b<>1 and b<>10 then for i from 1 to b-1 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: for i from b+1 to 10 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: fi: if b=1 then for i from b+1 to 10 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: fi: if b=10 then for i from 1 to b-1 do v[x]:=(u,i)->v[x](u-1,i): v[y]:=(u,i)->v[y](u-1,i): p[x]:=(u,i)->p[x](u-1,i)+(v[x](u,i))*tchoc: p[y]:=(u,i)->p[y](u-1,i)+(v[y](u,i))*tchoc: od: fi: p[x]:=(u,0)->p[x](u-1,0)+v[x](u-1,0)*tchoc: p[y]:=(u,0)->p[y](u-1,0)+v[y](u-1,0)*tchoc: p[x]:=(u,0)->p[x](u-1,b)+v[x](u-1,b)*tchoc: p[y]:=(u,0)->p[y](u-1,b)+v[y](u-1,b)*tchoc: solve({eq5(u-1,b),eq6(u-1,b),eq7(u-1,b),eq8(u-1,b)},{v[x](u,0),v[y](u,0),v[x](u,b),v[y](u,b)}): assign(%): fi: while tchoc<=2 do n:=n+1: od: RETURN(n): od: end: Warning, `v` is implicitly declared local to procedure `Bowling` Warning, `p` is implicitly declared local to procedure `Bowling` Warning, `e` is implicitly declared local to procedure `Bowling` Warning, `f` is implicitly declared local to procedure `Bowling` Warning, `eq1` is implicitly declared local to procedure `Bowling` Warning, `eq2` is implicitly declared local to procedure `Bowling` Warning, `eq3` is implicitly declared local to procedure `Bowling` Warning, `eq4` is implicitly declared local to procedure `Bowling` Warning, `eq5` is implicitly declared local to procedure `Bowling` Warning, `eq6` is implicitly declared local to procedure `Bowling` Warning, `eq7` is implicitly declared local to procedure `Bowling` Warning, `eq8` is implicitly declared local to procedure `Bowling` Warning, `z` is implicitly declared local to procedure `Bowling` Warning, `theta` is implicitly declared local to procedure `Bowling` Warning, `n` is implicitly declared local to procedure `Bowling` Warning, `m` is implicitly declared local to procedure `Bowling` Warning, `alpha` is implicitly declared local to procedure `Bowling` Warning, `d` is implicitly declared local to procedure `Bowling` Warning, `r` is implicitly declared local to procedure `Bowling` Warning, `R` is implicitly declared local to procedure `Bowling` Warning, `i` is implicitly declared local to procedure `Bowling` Warning, `j` is implicitly declared local to procedure `Bowling` Warning, `eq` is implicitly declared local to procedure `Bowling` Warning, `s` is implicitly declared local to procedure `Bowling` Warning, `q1` is implicitly declared local to procedure `Bowling` Warning, `q2` is implicitly declared local to procedure `Bowling` Warning, `u` is implicitly declared local to procedure `Bowling` Warning, `x` is implicitly declared local to procedure `Bowling` Warning, `q3` is implicitly declared local to procedure `Bowling` Warning, `q4` is implicitly declared local to procedure `Bowling` Warning, `w` is implicitly declared local to procedure `Bowling` Warning, `a` is implicitly declared local to procedure `Bowling` Warning, `b` is implicitly declared local to procedure `Bowling` Warning, `c` is implicitly declared local to procedure `Bowling` Warning, `tchoc` is implicitly declared local to procedure `Bowling` Error, symbol or symbol::type expected in parameter list > Bowling(3.14159265359/2);
-----