Using Mathematica to solve an ODE

  • Thread starter Thread starter Ashley1nOnly
  • Start date Start date
  • Tags Tags
    Mathematica Ode
Click For Summary
SUMMARY

The discussion focuses on using the NDSolve function in Mathematica to solve ordinary differential equations (ODEs). A user encountered issues with their syntax, specifically with the equation format and initial conditions. The correct syntax involves using '==' for equations and ensuring the right-hand side is properly defined, as demonstrated in the provided example. The user was advised to adjust their equation to reflect the correct relationship between variables.

PREREQUISITES
  • Familiarity with Mathematica 12.0 syntax
  • Understanding of ordinary differential equations (ODEs)
  • Knowledge of initial value problems
  • Basic experience with mathematical functions in programming
NEXT STEPS
  • Review Mathematica's NDSolve documentation for syntax guidelines
  • Practice solving initial value problems using NDSolve in Mathematica
  • Explore examples of ODEs with varying initial conditions
  • Learn about the differences between '==' and '=' in Mathematica
USEFUL FOR

Students, educators, and researchers in mathematics or engineering who are working with ordinary differential equations and utilizing Mathematica for computational solutions.

Ashley1nOnly
Messages
132
Reaction score
3

Homework Statement


upload_2018-9-4_13-2-12.png


Homework Equations


upload_2018-9-4_13-1-2.png

upload_2018-9-4_13-1-36.png


The Attempt at a Solution



I used the NDSolve function from mathematic but its giving me problems. What is the correct way to enter the equation?[/B]
soln = NDSolve[{y''[t] = (-9.8/5)*sin (t), y[0] = 20, y, {x, 0, 12}}]
 

Attachments

  • upload_2018-9-4_13-1-2.png
    upload_2018-9-4_13-1-2.png
    1 KB · Views: 696
  • upload_2018-9-4_13-1-36.png
    upload_2018-9-4_13-1-36.png
    1.1 KB · Views: 679
  • upload_2018-9-4_13-2-12.png
    upload_2018-9-4_13-2-12.png
    28.2 KB · Views: 642
Physics news on Phys.org
(1) The right hand side is not sin(t), it is sin(y[t]).

(2) Look more carefully at the syntax of the Mathematica NDSolve example below. Is your input in this form?

s = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}]
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
2
Views
2K
Replies
21
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 24 ·
Replies
24
Views
4K