Mathematica Differential Equation, help me see whats wrong

In summary, the conversation is about trying to recreate a magnetic pendulum simulation and encountering an error in the differential equation. The expert advises that the error may be due to a mistake in the formatting of the differential equation, specifically the use of multiple opening curly brackets.
  • #1
sm1t
6
0
Basically I am trying to recreate this http://mathforum.org/advanced/robertd/magneticpendulum.html

now my differential equation is
NDSolve[{x''[t] + Rx'[t] - Sum from i=1to3 of (x-x[t])/(rootof(x-x[t])^2 +[y-y[t])^2 +d^2)^3 + Qx[t]==0,
{y''[t] + Ry'[t] - Sum from i=1to3 of (y-y[t])/(rootof(x-x[t])^2 +[y-y[t])^2 +d^2)^3 + Qy[t]==0, x[0]==-.95, y[0]==0.09, x'[0]==0, y'[0]==0}, {x,y}, {t,0,100}, MaxSteps -> 1000]
I have assigned values to R Q and d, and please note than the x's and y's which are not of t, should be subscript i.

I get the error,
"The first argument must have both an equation and an initial condition."

I keep compare my equation to other example equations but I can't see what's wrong.

Any anyone shed any light?

Very much appreciated.
 
Physics news on Phys.org
  • #2
As far as I can tell, you started off the set of differential equations with an opening { but then re-opened with another {. The form should be NDSolve[{f1(vars),f2(fars)},{vars}...] and so on and so forth.
 

1. What is Mathematica Differential Equation?

Mathematica Differential Equation is a software program used for solving and analyzing differential equations. It is commonly used in scientific and mathematical research to model and understand various physical and mathematical systems.

2. How does Mathematica solve differential equations?

Mathematica uses a combination of numerical and symbolic methods to solve differential equations. It first converts the differential equation into a system of algebraic equations and then uses advanced mathematical algorithms to find an accurate solution.

3. What types of differential equations can Mathematica solve?

Mathematica can solve a wide range of differential equations, including ordinary differential equations (ODEs), partial differential equations (PDEs), and boundary value problems. It can also handle systems of differential equations and equations with variable coefficients.

4. How can I check if my solution from Mathematica is correct?

Mathematica provides extensive built-in functions for verifying the accuracy of the solution to a differential equation. You can compare the numerical solution to the symbolic solution, visualize the solution using graphs, or use analytical techniques to confirm the result.

5. What are some common mistakes when using Mathematica for differential equations?

Some common mistakes include not specifying the initial conditions or boundary conditions correctly, using incorrect syntax, or not understanding the underlying mathematical concepts. It is also essential to check for any warnings or errors that may indicate a problem with the solution.

Similar threads

Replies
2
Views
1K
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
137
  • Advanced Physics Homework Help
Replies
2
Views
829
  • Calculus and Beyond Homework Help
Replies
7
Views
284
  • Advanced Physics Homework Help
Replies
1
Views
999
  • Programming and Computer Science
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
900
  • Advanced Physics Homework Help
Replies
1
Views
915
Back
Top