 |
Apprendre Maple Site dédié au logiciel de calcul formel Maple
|
Voir le sujet précédent :: Voir le sujet suivant |
Auteur |
Message |
bendesarts
Inscrit le: 27 Fév 2009 Messages: 234
|
Posté le: 19 Mar 2016 19:12 Sujet du message: subs répété |
|
|
Bonjour,
Je cherche une fonction en maple ou faire un bout de code qui puisse faire des substitutions de manière répétée. En d'autres termes, réitère les changements de variables jusqu'au moment où il n'y a plus de changement de substitutions possibles.
En Mathematica, on peut faire des substitutions de manière répétée à l'aide d'une fonction (code mathematica //.).
Voici un exemple que j'aimerais résoudre avec maple :
Equation sur laquelle j'aimerais réaliser des changements de variables :
Code: | eq := sin(psi[1](t)+gamma0(t))*cf+sin(gamma0(t)+theta[1](t)+psi[1](t))*mf-sin(gamma0(t))*hf-cos(gamma0(t))*lf+xp[1](t) = sin(psi[2](t)+gamma0(t))*cf+sin(gamma0(t)+theta[2](t)+psi[2](t))*mf-sin(gamma0(t))*hf-cos(gamma0(t))*lf+xp[2](t)eq[1] := sin(psi[1](t)+gamma0(t))*cf+sin(gamma0(t)+theta[1](t)+psi[1](t))*mf-sin(gamma0(t))*hf-cos(gamma0(t))*lf+xp[1](t) = sin(psi[2](t)+gamma0(t))*cf+sin(gamma0(t)+theta[2](t)+psi[2](t))*mf-sin(gamma0(t))*hf-cos(gamma0(t))*lf+xp[2](t) |
Définition des changements de variables :
Code: | ChgtVariables:=psi[1](t)=Psi[1](t) - theta[1](t) + gamma[1](t),psi[2](t)=Psi[2](t) - theta[2](t) + gamma[2](t);psi[3](t)=Psi[3](t) - theta[3](t) + gamma[3](t),psi[4](t)=Psi[4](t) - theta[4](t) + gamma[4](t),theta[1](t)=Theta[1](t)+gamma[1](t),theta[2](t)=Theta[2](t)+gamma[2](t),theta[3](t)=Theta[3](t)+gamma[3](t),theta[4](t)=Theta[4](t)+gamma[4](t); |
Application de la fonction subs
Code: | subs(ChgtVariables,eq); |
--> MON REVE : Cà serait qu'il y ait une option dans la fonction subs qui permettent de faire des substitutions répétées
Résultat :
sin(Psi(t)-theta[1](t)+gamma[1](t)+gamma0(t))*cf+sin(gamma0(t)+Psi(t)+gamma[1](t))*mf-sin(gamma0(t))*hf-cos(gamma0(t))*lf+xp[1](t) = sin(Psi(t)-theta[2](t)+gamma[2](t)+gamma0(t))*cf+sin(gamma0(t)+Psi(t)+gamma[2](t))*mf-sin(gamma0(t))*hf-cos(gamma0(t))*lf+xp[2](t)
Pour info, avec la fonction subsitution répétée en Mathematica,
Merci d'avance pour votre aide.[/img] |
|
Revenir en haut de page |
|
 |
ALS
Inscrit le: 11 Sep 2006 Messages: 647
|
Posté le: 20 Mar 2016 7:41 Sujet du message: |
|
|
Bonjour,
Il y a une différence sur Psi au niveau des équations transmises à Mathematica et à Maple.
Si on reprend les données transmises à Mathematica avec Psi(t) à la place des Psi[i](t) i=1..4 :
Code: |
eq := sin(psi[1](t)+gamma0(t))*cf+sin(gamma0(t)+theta[1](t)+psi[1](t))*mf-sin(gamma0(t))*hf-cos(gamma0(t))*lf+xp[1](t) = sin(psi[2](t)+gamma0(t))*cf+sin(gamma0(t)+theta[2](t)+psi[2](t))*mf-sin(gamma0(t))*hf-cos(gamma0(t))*lf+xp[2](t);
eq := sin(psi[1](t) + gamma0(t)) cf
+ sin(gamma0(t) + theta[1](t) + psi[1](t)) mf
- sin(gamma0(t)) hf - cos(gamma0(t)) lf + xp[1](t) =
sin(psi[2](t) + gamma0(t)) cf
+ sin(gamma0(t) + theta[2](t) + psi[2](t)) mf
- sin(gamma0(t)) hf - cos(gamma0(t)) lf + xp[2](t)
> ChgtVariables:=psi[1](t)=Psi(t) - theta[1](t) + gamma[1](t),psi[2](t)=Psi(t) - theta[2](t) + gamma[2](t);psi[3](t)=Psi(t) - theta[3](t) + gamma[3](t),psi[4](t)=Psi(t) - theta[4](t) + gamma[4](t),theta[1](t)=Theta[1](t)+gamma[1](t),theta[2](t)=Theta[2](t)+gamma[2](t),theta[3](t)=Theta[3](t)+gamma[3](t),theta[4](t)=Theta[4](t)+gamma[4](t);
ChgtVariables := psi[1](t) = Psi(t) - theta[1](t) + gamma[1](t),
psi[2](t) = Psi(t) - theta[2](t) + gamma[2](t)
psi[3](t) = Psi(t) - theta[3](t) + gamma[3](t),
psi[4](t) = Psi(t) - theta[4](t) + gamma[4](t),
theta[1](t) = Theta[1](t) + gamma[1](t),
theta[2](t) = Theta[2](t) + gamma[2](t),
theta[3](t) = Theta[3](t) + gamma[3](t),
theta[4](t) = Theta[4](t) + gamma[4](t)
> eq1:=collect(rhs(eq)-lhs(eq),[cf,mf])=0;
eq1 :=
(-sin(psi[1](t) + gamma0(t)) + sin(psi[2](t) + gamma0(t))) cf
+ (-sin(gamma0(t) + theta[1](t) + psi[1](t))
+ sin(gamma0(t) + theta[2](t) + psi[2](t))) mf - xp[1](t)
+ xp[2](t) = 0
> subs(ChgtVariables,eq1);
(-sin(Psi(t) - theta[1](t) + gamma[1](t) + gamma0(t))
+ sin(Psi(t) - theta[2](t) + gamma[2](t) + gamma0(t))) cf +
(-sin(gamma0(t) + Psi(t) + gamma[1](t))
+ sin(gamma0(t) + Psi(t) + gamma[2](t))) mf - xp[1](t)
+ xp[2](t) = 0
|
On obtient une forme équivalente à Mathematica mais mal simplifiée. |
|
Revenir en haut de page |
|
 |
|
|
Vous ne pouvez pas poster de nouveaux sujets dans ce forum Vous ne pouvez pas répondre aux sujets dans ce forum Vous ne pouvez pas éditer vos messages dans ce forum Vous ne pouvez pas supprimer vos messages dans ce forum Vous ne pouvez pas voter dans les sondages de ce forum
|

Développé par phpBB © 2001, 2006 phpBB Group
Traduction par : phpBB-fr.com
Apprendre Maple - © 02/04/2025
- Alain Le Stang - Navigation optimisée pour une résolution 1024 x 768.
|