## Analyse des forces dans une suspension de type _double whishbone_ Plan provenant du prototype (jamais construit) de la [Chubasco 1990 de Maserati](http://www.automobile-catalog.com/make/maserati/chubasco/chubasco_concept/1990.html) ```python import numpy as np from math import * def chuba(n, m): "retourne le vecteur position reliant le point n vers le point m" points = [[6.13,-14.10], [8.57,13.10], [39.68,8.52], [47.51,-13.10], [10.02,-14.03], [42.55,20.36], [45.40,12.73], [55.44,16.06], [48.46,-13.28], [0.00,-26.17]] return Vecteur(points[m-1]) - Vecteur(points[n-1]) def unit(theta): "retourne le vecteur unitaire définit par l'angle theta en deg" theta_rad = pi*theta/180. return Vecteur([cos(theta_rad), sin(theta_rad)]) def v(x, y): "retourne un vecteur dont les composantes sont x et y" return Vecteur([x,y]) def module(vect): "retourne la norme du vecteur vect" return np.linalg.norm(vect) class Vecteur(np.ndarray): def __new__(cls, input_array): # Input array is an already formed ndarray instance # We first cast to be our class type obj = np.asarray(input_array).view(cls) # add the new attribute to the created instance # Finally, we must return the newly created object: return obj def __invert__(self): "~ vect normalise le vecteur" norm = np.linalg.norm(self) return self/norm def __mul__(self, arg): "A*B correspond au produit vecoriel" return np.cross(self, arg) ```   L'équilibre en rotation de la pièce isolée (avec pivot au point 1) permet d'écrire l'équation: $$ M_{SA} = - M_{BA}$$ $$\overrightarrow{R_{12}} \times \overrightarrow{BA} = - \overrightarrow{R_{110}} \times \overrightarrow{SA}$$ où $\overrightarrow{BA}$ est le seul vecteur inconnu, donc calculable! Les conventions d'écriture suivantes sont utilisées: * BA est la force _par_ la pièce B _sur_ la pièce A et SA, la force par S sur A; * $\overrightarrow{R_{12}}$ est le vecteur position qui va du point 1 vers le point 2. Les outils informatiques de calcul suivants sont disponibles: * `chuba(1,2)` génère le vecteur position qui va de la jonction 1 vers la jonction 2 * `~AB` est le vecteur unitaire $\widehat{AB}$ * `AB*CD` évalue le produit vectoriel $\overrightarrow{AB} \times \overrightarrow{CD}$ * `v(x,y)` donne le vecteur de composantes x et y ```python SA=v(0,1000) SA ``` Vecteur([ 0, 1000]) Comment isoler le module de la force $\overrightarrow{BA}$ dans l'équation précédente? $$\overrightarrow{R_{12}} \times \overrightarrow{BA} = - \overrightarrow{R_{110}} \times \overrightarrow{SA}$$ il suffit de dévelloper le vecteur $\overrightarrow{BA}$ comme étant le produit de son module et sa direction: $$ \overrightarrow{BA} = BA \cdot \widehat{BA}$$ $$\overrightarrow{R_{12}} \times (BA \cdot \widehat{BA}) = - \overrightarrow{R_{110}} \times \overrightarrow{SA}$$ $$ BA \cdot (\overrightarrow{R_{12}} \times \widehat{BA}) = - \overrightarrow{R_{110}} \times \overrightarrow{SA}$$ et alors $$ BA = - \frac{\overrightarrow{R_{110}} \times \overrightarrow{SA}} {\overrightarrow{R_{12}} \times \widehat{BA}}$$ en module, et pour le vecteur: $$ \overrightarrow{BA} = - \frac{\overrightarrow{R_{110}} \times \overrightarrow{SA}} {\overrightarrow{R_{12}} \times \widehat{BA}} \widehat{BA} $$ où $\widehat{BA}$ apparaît deux fois: il est donc utile de le calculer au préalable. $\widehat{BA}$ est la direction de la force BA et donc parallèle à la pièce B (effort axial pur). Cette direction est définie par les points 3 vers 2. On a alors $\widehat{BA}$ = ` r32d = ~chuba(3,2)` : ```python r32d=~chuba(3,2) # vecteur unitaire en direction de (3,2) r32d ``` Vecteur([-0.98933623, 0.14564963]) Le vecteur force BA $$ \overrightarrow{BA} = - \frac{\overrightarrow{R_{110}} \times \overrightarrow{SA}} {\overrightarrow{R_{12}} \times \widehat{BA}} \widehat{BA} $$ finalement s'évalue ainsi: ```python BA = chuba(1,10)*SA/(-chuba(1,2)*r32d)*r32d print(BA) ``` [-222.43013262 32.7460626 ] La force manquante sur la pièce A s'obtient par équilibre de translation: $$ \overrightarrow{SA} + \overrightarrow{BA} + \overrightarrow{CA} = 0 $$ $$ \overrightarrow{CA} = -(\overrightarrow{SA} + \overrightarrow{BA} ) $$ ```python CA = -(BA+SA) print(CA) ``` [ 222.43013262 -1032.7460626 ] On parcourt l'assemblage en résolvant les équations de pièce en pièce... ```python CA ``` Vecteur([ 222.43013262, -1032.7460626 ]) ```python print(CA) ``` [ 222.43013262 -1032.7460626 ]