Hello, how do I implement the following second order differential equation with input variable t (0 to 300) and output the corresponding displacement h? Thank you.
Looks like we have a 2nd-order differential equation of function . To clean the problem up, let's define some constants:
, , , ,
Then we have the following expression:
Now get by itself so we can use a numerical method to integrate the system:
Suppose you define . Then the system is determined for when you specify the initial conditions: .
Notice that .
Let a very small change in t be denoted . Then you could approximate the value of using the relation .
So the process looks like this:
1. Start at and specify the initial conditions and . This allows you to calculate .
2. Use and to determine and h after a tiny step . Now you can calculate .
3. Use and to determine and h after another tiny step . Update the value of .
4. Repeat until .
This process is called "rectangular integration" and it allows you to numerically solve DEs quickly. If you want higher accuracy, you can use a Runge-Kutta method. These methods follow a very similar procedure but reduce the estimation error at every step. A popular one is a fourth-order method commonly called "RK4."
EDIT: I played around simplifying the original equations. Notice that .
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Translated by
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.