Lunga equazione matriciale

  • Questo topic ha 7 risposte, 3 partecipanti ed è stato aggiornato l'ultima volta 6 anni fa da egreg9.
  • Creatore
    Topic
  • #118557
    Up
    0
    Down
    ::


    Buongiorno a tutti, ho di recente iniziato a scrivere la mia tesi su LaTeX e ho riscontrato ieri questa difficoltà: sono alle prese con lo sviluppo di un’ equazione matriciale ma purtroppo alla compilazione mi da come errore che l’equazione risulta essere troppo grande, ho già provato a splittarla ma viene lo stesso risultato. In allegato potete trovare l’equazione.
    Riuscite a darmi una mano su come riuscire a inserirla?
    Vorrei inserirla esattamente come è indicato in foto.
    Grazie mille in anticipo.
    [attachment=2487]Equazione.png[/attachment]

    Attachments:
    You must be logged in to view attached files.
Visualizzazione 6 filoni di risposte
  • Autore
    Risposte
    • #118558
      OldClaudio
      Partecipante
        Up
        0
        Down
        ::


        Siccome il secondo addendo e il terzo addendo contengono inizialmente la stessa matrice, raccoglila e usa le parentesi. Non ti posso far vedere come perché nonhai allegato un esempio minimo compilabile che permetta di modificarlo per verificare se quello che ti ho suggerito funziona.

      • #118559
        Up
        0
        Down
        ::


        Ti scrivo come ho messo giù l’equazione io.. Perdonami, sicuramente ci saranno errori ma ho preso in mano ieri questo programma per la prima volta.

        [attachment=2488]Schermata2020-09-06alle12.48.04.jpg[/attachment]

        Attachments:
        You must be logged in to view attached files.
      • #118560
        Up
        0
        Down
        ::


        \begin{equation}
        \begin{split}
        \begin{bmatrix}
        p \\
        q \\
        r
        \end{bmatrix} & = \begin{bmatrix}
        \dot{phi} \\
        0 \\
        0
        \end{bmatrix} + \begin{bmatrix}
        1 & 0 & 0 \\
        0 & \cos\phi & \sin\phi \\
        0 & -\sin\phi & \cos\phi
        \end{bmatrix} \begin{bmatrix}
        0 \\
        \dot{theta} \\
        0
        \end{bmatrix} + \begin{bmatrix}
        1 & 0 & 0 \\
        0 & \cos\phi & \sin\phi \\
        0 & -\sin\phi & \cos\phi
        \end{bmatrix} \begin{bmatrix}
        \cos\theta & 0 & -\sin\theta \\
        0 & 1 & 0 \\
        \sin\theta & 0 & \cos\theta \end{bmatrix} \begin{bmatrix}
        0 \\
        0 \\
        \dot{psi}
        \end{bmatrix} \\
        & = \begin{bmatrix}
        \dot{phi} – \sin\theta \dot{psi} \\
        \cos\phi \dot{theta} + \sin\theta \cos\theta \dot{psi}
        -\sin\phi \dot{theta} + \cos\phi \cos\theta \dot{psi}
        \end{bmatrix}\\
        & = \begin{bmatrix}
        1 & 0 & -\sin\theta \\
        0 & \cos\phi & \sin\phi \cos\theta \\
        0 & -\sin\phi & \cos\phi \cos\theta
        \end{bmatrix} \begin{bmatrix}
        \dot{phi} \\
        \dot{theta} \\
        \dot{\psi}
        \end{bmatrix} \text{.}
        \end{split}
        \end{equation}

      • #118561
        OldClaudio
        Partecipante
          Up
          0
          Down
          ::


          Se ci fornisci un’immagine, per testare il tuo codice bisogna riscrivere tutto quello che hai fotografato; invece il codice lo devi semplicemente copiare dal tuo file .tex e incollarlo nel messaggio fra i due tage che trovi nella barra qui sopra; oppure evidenzi il codice incollato, poi clicchi sull’icona qui sopra checontiene un rettangolo bianco con un’orecchietta in alto a destra e su cui ci sono i segni < > colorati di blu.

        • #118562
          Up
          0
          Down
          ::


          `\begin{equation}
          \begin{split}
          \begin{bmatrix}
          p \\
          q \\
          r
          \end{bmatrix} & = \begin{bmatrix}
          \dot{phi} \\
          0 \\
          0
          \end{bmatrix} + \begin{bmatrix}
          1 & 0 & 0 \\
          0 & \cos\phi & \sin\phi \\
          0 & -\sin\phi & \cos\phi
          \end{bmatrix} \begin{bmatrix}
          0 \\
          \dot{theta} \\
          0
          \end{bmatrix} + \begin{bmatrix}
          1 & 0 & 0 \\
          0 & \cos\phi & \sin\phi \\
          0 & -\sin\phi & \cos\phi
          \end{bmatrix} \begin{bmatrix}
          \cos\theta & 0 & -\sin\theta \\
          0 & 1 & 0 \\
          \sin\theta & 0 & \cos\theta \end{bmatrix} \begin{bmatrix}
          0 \\
          0 \\
          \dot{psi}
          \end{bmatrix} \\
          & = \begin{bmatrix}
          \dot{phi} – \sin\theta \dot{psi} \\
          \cos\phi \dot{theta} + \sin\theta \cos\theta \dot{psi}
          -\sin\phi \dot{theta} + \cos\phi \cos\theta \dot{psi}
          \end{bmatrix}\\
          & = \begin{bmatrix}
          1 & 0 & -\sin\theta \\
          0 & \cos\phi & \sin\phi \cos\theta \\
          0 & -\sin\phi & \cos\phi \cos\theta
          \end{bmatrix} \begin{bmatrix}
          \dot{phi} \\
          \dot{theta} \\
          \dot{\psi}
          \end{bmatrix} \text{.}
          \end{split}
          \end{equation}
          `

        • #118563
          OldClaudio
          Partecipante
            Up
            0
            Down
            ::


            Tradotto in codice quello che ti avevo consigliato è il seguente.`\begin{equation}
            \begin{split}
            \begin{bmatrix}
            p \\
            q \\
            r
            \end{bmatrix} & = \begin{bmatrix}
            \dot{phi} \\
            0 \\
            0
            \end{bmatrix} + \begin{bmatrix}
            1 & 0 & 0 \\
            0 & \cos\phi & \sin\phi \\
            0 & -\sin\phi & \cos\phi
            \end{bmatrix}
            \left( % grande parentesi tonda aperta
            \begin{bmatrix}
            0 \\
            \dot{theta} \\
            0
            \end{bmatrix} +
            %\begin{bmatrix} % matrice cancellata
            %1 & 0 & 0 \\
            %0 & \cos\phi & \sin\phi \\
            %0 & -\sin\phi & \cos\phi
            %\end{bmatrix}
            %
            \begin{bmatrix}
            \cos\theta & 0 & -\sin\theta \\
            0 & 1 & 0 \\
            \sin\theta & 0 & \cos\theta \end{bmatrix} \begin{bmatrix}
            0 \\
            0 \\
            \dot{psi}
            \end{bmatrix}
            \right) % grande parentesi tonda chiusa
            \\
            & = \begin{bmatrix}
            \dot{phi} – \sin\theta \dot{psi} \\
            \cos\phi \dot{theta} + \sin\theta \cos\theta \dot{psi}
            -\sin\phi \dot{theta} + \cos\phi \cos\theta \dot{psi}
            \end{bmatrix}\\
            & = \begin{bmatrix}
            1 & 0 & -\sin\theta \\
            0 & \cos\phi & \sin\phi \cos\theta \\
            0 & -\sin\phi & \cos\phi \cos\theta
            \end{bmatrix} \begin{bmatrix}
            \dot{phi} \\
            \dot{theta} \\
            \dot{\psi}
            \end{bmatrix} \text{.}
            \end{split}
            \end{equation}
            `

          • #118564
            Up
            0
            Down
            ::


            La prima riga è troppo lunga per una giustezza normale. Un’idea può essere quella di spezzarla in due.

            `
            \documentclass{article}
            \usepackage{amsmath}

            \begin{document}

            \begin{equation}
            \begin{split}
            \begin{bmatrix}
            p \\
            q \\
            r
            \end{bmatrix}
            & =
            \begin{bmatrix}
            \dot{\phi} \\
            0 \\
            0
            \end{bmatrix}
            \begin{aligned}[t] & % <-- + \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos\phi & \sin\phi \\ 0 & -\sin\phi & \cos\phi \end{bmatrix} \begin{bmatrix} 0 \\ \dot{\theta} \\ 0 \end{bmatrix} \\ & % <-- + \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos\phi & \sin\phi \\ 0 & -\sin\phi & \cos\phi \end{bmatrix} \begin{bmatrix} \cos\theta & 0 & -\sin\theta \\ 0 & 1 & 0 \\ \sin\theta & 0 & \cos\theta \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ \dot{\psi} \end{bmatrix} \end{aligned} % <-- \\ & = \begin{bmatrix} \dot{\phi} - \dot{\psi}\sin\theta \\ \dot{\theta}\cos\phi + \dot{\psi}\sin\theta \cos\theta \\ -\dot{\theta}\sin\phi + \dot{\psi}\cos\phi \cos\theta \end{bmatrix}\\ & = \begin{bmatrix} 1 & 0 & -\sin\theta \\ 0 & \cos\phi & \sin\phi \cos\theta \\ 0 & -\sin\phi & \cos\phi \cos\theta \end{bmatrix} \begin{bmatrix} \dot{\phi} \\ \dot{\theta} \\ \dot{\psi} \end{bmatrix} . \end{split} \end{equation} \end{document} ` [attachment=2489]Screenshot2020-09-07at16.50.36.png[/attachment] Se invece la giustezza (cioè la lunghezza delle righe è sufficiente), basta eliminare le righe segnate con [tt]% <---[/tt] Non è “esattamente come”, ma le derivate appiccicate in fondo sono davvero orribili. Attenzione: [tt]\dot{psi}[/tt] è sbagliato e deve essere [tt]\dot{\psi}[/tt]. Ciao Enrico

            Attachments:
            You must be logged in to view attached files.
        Visualizzazione 6 filoni di risposte
        • Devi essere connesso per rispondere a questo topic.

        Go to top