001    /*
002     * @(#)MohrSolver.java
003     */
004    
005    /**
006     * MohrSolver.java - Solver of Mohr Circle.
007     *
008     * <p>
009     * Description:
010     * <p>
011     * ===============================================================
012     * <p>
013     * This file contains an implementation of the Mohr Circle for
014     * plane stresses.  For more details of this process, refer to
015     * book "Mecânica dos Sólidos, Timoshenko & Gere".
016     *
017     * <p>
018     * ===============================================================
019     *
020     * @version    1.0 04/09/2004
021     * @author     Luiz Fernando Martha
022     * @author     Alonso Juvinao Carbono
023     * @author     Anderson Resende Pereira
024     * @author     Fernando Busato Ramires
025     * @author     Paôla Reginal Dalcanal
026     * @author     Ricardo Rodrigues de Araujo  
027     *
028     */
029    public class MohrSolver
030    {
031     /*
032     ** ---------------------------------------------------------------
033     ** Protected instance variables:
034     */
035    
036     /** Tensão normal na direção x */
037     protected double sigmax;
038    
039     /** Tensão normal na direção y */
040     protected double sigmay;
041    
042     /** Tensão de cisalhamento */
043     protected double tauxy;
044    
045     /** Ângulo da normal do plano em relação ao eixo x (no sentido anti-horário) */
046     protected double theta;
047    
048     /*
049     ** ---------------------------------------------------------------
050     ** Package instance variables:
051     */
052    
053     /*
054     ** ---------------------------------------------------------------
055     ** Private and Protected methods: 
056     */
057    
058     /*
059     ** ---------------------------------------------------------------
060     ** Public methods: 
061     */
062    
063     /*=======================  Constructor  =========================*/
064     /**
065      * Cria um objeto MohrSolver para um conjunto completo de dados.
066      */
067     public MohrSolver( double sigmax, double sigmay, 
068                        double tauxy, double theta )
069     {
070      this.sigmax = sigmax;
071      this.sigmay = sigmay;
072      this.tauxy = tauxy;
073      this.theta = theta;
074     }
075    
076     /*=======================  Constructor  =========================*/
077     /**
078      * Cria um objeto MohrSolver com valores default.
079      */
080     public MohrSolver( )
081     {
082      this( 100.0, 50.0, 25.0, Math.toRadians( 52.0 ) );
083     }
084    
085     /*======================  ChkNullStateStr  ========================*/
086     /**
087      * Verifica se as componentes de tensão passadas como parâmetros
088      * foram um estado de tensões nulo.
089      */
090     static protected boolean ChkNullStateStr( double sigmax, double sigmay, 
091                                               double tauxy )
092     {
093      if( Math.sqrt(sigmax*sigmax + sigmay*sigmay + tauxy*tauxy) < 0.1 )
094       return( true );
095    
096      return( false );
097     }
098     /*=========================  ResetSolver  =========================*/
099     /**
100      * Inicializa os parâmetros do objeto MohrSolver com valores default.
101      */
102     public void ResetSolver()
103     {
104      sigmax = 100.0;
105      sigmay = 50.0;
106      tauxy = 25.0;
107      theta = Math.toRadians( 52.0 );
108     }
109    
110     /*========================  setSigmaX  =========================*/
111     /**
112      * Altera o valor corrente da tensão normal sigmax.
113      */
114     public void setSigmaX( double sigmax )
115     {
116      if( ChkNullStateStr( sigmax, this.sigmay, this.tauxy ) )
117       return;
118    
119      this.sigmax = sigmax;
120     }
121    
122     /*========================  setSigmaY  =========================*/
123     /**
124      * Altera o valor corrente da tensão normal sigmay.
125      */
126     public void setSigmaY( double sigmay )
127     {
128      if( ChkNullStateStr( this.sigmax, sigmay, this.tauxy ) )
129       return;
130    
131      this.sigmay = sigmay;
132     }
133    
134     /*========================  setTauXY  =========================*/
135     /**
136      * Altera o valor corrente da tensão de cisalhamento tauxy.
137      */
138     public void setTauXY( double tauxy )
139     {
140      if( ChkNullStateStr( this.sigmax, this.sigmay, tauxy ) )
141       return;
142    
143      this.tauxy = tauxy;
144     }
145    
146     /*========================  setTheta  =========================*/
147     /**
148      * Altera o valor corrente do ângulo da normal do plano de 
149      * resposta (em radianos).  O valor do ângulo é sempre 
150      * transformado para a faixa entre 0 e 180 graus.
151      */
152     public void setTheta( double theta )
153     {
154      int    ip;             /* integer part */
155      double fp;             /* "fraction" part */
156    
157    /* Primeiro corrige o ângulo para um valor com
158     * módulo menor que 360 graus.
159     */
160      fp = theta / (2.0*Math.PI);
161      ip = (int)fp;
162      theta = theta - (ip*2.0*Math.PI) ;
163    
164    /* Agora transforma ângulo para a faixa entre 0 e 180 graus.
165     */
166      if( theta < 0.0 )
167       theta = Math.PI + theta;
168      else if( theta > Math.PI )
169       theta = theta - Math.PI;
170    
171      this.theta = theta;
172     }
173    
174     /*========================  getSigmaX  =========================*/
175     /**
176      * Retorna o valor corrente da tensão normal sigmax.
177      */
178     public double getSigmaX( )
179     {
180      return( sigmax );
181     }
182    
183     /*========================  getSigmaY  =========================*/
184     /**
185      * Retorna o valor corrente da tensão normal sigmay.
186      */
187     public double getSigmaY( )
188     {
189      return( sigmay );
190     }
191    
192     /*========================  getTauXY  =========================*/
193     /**
194      * Retorna o valor corrente da tensão de cisalhamento.
195      */
196     public double getTauXY( )
197     {
198      return( tauxy );
199     }
200    
201     /*========================  getTheta  =========================*/
202     /**
203      * Retorna o valor corrente do ângulo que define a direção do
204      * plano de resposta (em radianos).
205      */
206     public double getTheta( )
207     {
208      return( theta );
209     }
210    
211     /*========================  Center  =========================*/
212     /**
213      * Retorna o valor médio da tensão normal do estado corrente.
214      */
215     public double Center( )
216     {
217      return( (sigmax + sigmay) * 0.5 );
218     }
219    
220     /*========================  Radius  =========================*/
221     /**
222      * Retorna o valor do raio do círculo de Mohr correspondente
223      * ao estado de tensão corrente.
224      */
225     public double Radius( )
226     {
227      double sigmaux = Math.abs(sigmax - sigmay) * 0.5;
228    
229      return( Math.sqrt(sigmaux*sigmaux + tauxy*tauxy) );
230     }
231    
232     /*========================  Sigma1  =========================*/
233     /**
234      * Retorna o valor da tensão normal máxima do estado corrente.
235      */
236     public double Sigma1( )
237     {
238      return( this.Center( ) + this.Radius( ) );
239     }
240    
241     /*========================  Sigma2  =========================*/
242     /**
243      * Retorna o valor da tensão normal mínima do estado corrente.
244      */
245     public double Sigma2( )
246     {
247      return( this.Center( ) - this.Radius( ) );
248     }
249    
250     /*========================  TauMax  =========================*/
251     /**
252      * Retorna o valor máximo em módulo da tensão de cisalhamento.
253      */
254     public double TauMax( )
255     {
256      return( this.Radius( ) );
257     }
258    
259     /*========================  SigmaTheta  =========================*/
260     /**
261      * Retorna o valor da tensão normal no plano cuja normal é defina
262      * pelo valor corrente de theta.
263      */
264     public double SigmaTheta(  )
265     {
266      double sigmaux = (sigmax - sigmay) * 0.5;
267      double thetaux = 2.0*theta;
268    
269      return( this.Center( )+sigmaux*Math.cos(thetaux)+tauxy*Math.sin(thetaux) );
270     }
271    
272     /*========================  SigmaTheta90  =========================*/
273     /**
274      * Retorna o valor da tensão normal no plano cuja normal é defina
275      * pelo valor corrente de theta + 90 graus.
276      */
277     public double SigmaTheta90(  )
278     {
279      double sigmaux = (sigmax - sigmay) * 0.5;
280      double thetaux = 2.0*(theta+(Math.PI/4.0));
281    
282      return( this.Center( )+sigmaux*Math.cos(thetaux)+tauxy*Math.sin(thetaux) );
283     }
284    
285     /*========================  TauTheta  =========================*/
286     /**
287      * Retorna o valor da tensão de cisalhamento no plano cuja normal
288      * é defina pelo valor corrente de theta.
289      */
290     public double TauTheta(  )
291     {
292      double sigaux = (sigmax - sigmay) * 0.5;
293      double thetaux = 2.0*theta;
294    
295      return( sigaux*Math.sin(thetaux) - tauxy*Math.cos(thetaux) );
296     }
297    
298     /*========================  ThetaP  =========================*/
299     /**
300      * Retorna o valor do ângulo que a normal do plano onde 
301      * ocorre a tensão normal principal máxima faz com o eixo x 
302      * (em radianos).  O valor do ângulo é sempre transformado 
303      * para a faixa entre 0 e 180 graus.
304      */
305     public double ThetaP(  )
306     {
307      double sigmaux = (sigmax - sigmay) * 0.5;
308      double thetap;
309    
310      if( Math.abs( sigmaux ) > 0.0 )
311       thetap = 0.5 * Math.atan2(tauxy,sigmaux);
312      else if( tauxy > 0.0 )
313       thetap = Math.PI / 4.0;
314      else if( tauxy < 0.0 )
315       thetap = -Math.PI / 4.0;
316      else
317       thetap = 0.0;
318    
319    /* Transforma ângulo para a faixa entre 0 e 180 graus.
320     */
321      if( thetap < 0.0 )
322       thetap = Math.PI + thetap;
323    
324      return( thetap );
325     }
326    
327     /*=====================  IsHydrostatic  ======================*/
328     /**
329      * Retorna um flag para estado hidrostático de tensões:
330      * se verdadeiro, estado de tensões corrente é hidrostático,
331      * se falso, não é hidrostático.
332      */
333     public boolean IsHydrostatic( )
334     {
335      int type;
336    
337      if( (Math.abs( sigmax - sigmay ) < 0.01) &&
338          (Math.abs( tauxy ) < 0.01) )
339      {
340       return( true );
341      }
342    
343      return( false );
344     }
345    
346     /*========================  PoleX  ========================*/
347     /**
348      * Retorna coordenada horizontal do polo.
349      */
350     public double PoleX( )
351     {
352      return( sigmay );
353     }
354    
355     /*========================  PoleY  ========================*/
356     /**
357      * Retorna coordenada vertical do polo.
358      */
359     public double PoleY( )
360     {
361      return( -tauxy );
362     }
363    
364    }
365