Message Boards Message Boards


Mathematica only rewrites the differential equation

Posted 9 years ago
3 Replies
3 Total Likes

Hi, So i am trying to solve this differential equation. However when i press shift+enter Mathematica just rewrites the equation, not giving an answer. I would like to graph the result aswell. This is what it looks like:

Equation1 = 
     t] == (((0.01*4 \[Pi]*10^-7*
          L[t]*(440*e^(-t/(0.5*0.0025)))^2/\[Pi])*(0.01^2 + (L[t]^2 - 
             L[t]*Sqrt[0.01^2 + L[t]^2]))/Sqrt[0.01^2 + L[t]^2])/
      0.01), L[0] == 0.001, L'[0] == 0.01}, L, {t, 0, 0.1}]

And it gives me the answer:

Dsolve[{(L^\[Prime]\[Prime])[t] == (
   0.07744 e^(-1600. t)
     L[t] (0.0001 + L[t]^2 - L[t] Sqrt[0.0001 + L[t]^2]))/Sqrt[
   0.0001 + L[t]^2], L[0] == 0.001, 
  Derivative[1][L][0] == 0.01}, L, {t, 0, 0.1}]

which is basically only a rewriting... what should i do to solve it? I am new to mathematica so i guess it is a typing-error somewhere, can anyone assist me? I attach the file below if you want to try yourself and my goal is to find the L. Regards Mattias Pettersson :)

3 Replies

Hi Mattias,

there are several problems with your input:

  1. The Function DSolve is written with a capital S.
  2. The function you want to use here is NDSolve.
  3. You use e^ which is not correct. e is either Exp[1] or you wrap Exp around the exponent or you use the special symbol or use E, but not simply e.

This piece of code should work:

Equation1 = 
 NDSolve[{L''[t] == (((0.01*4 ?*10^-7*L[t]*(440*Exp[1]^(-t/(0.5*0.0025)))^2/?)*(0.01^2 + (L[t]^2 - L[t]*Sqrt[0.01^2 + L[t]^2]))/
         Sqrt[0.01^2 + L[t]^2])/0.01), L[0] == 0.001, L'[0] == 0.01}, L, {t, 0, 0.1}]

You can plot it like so:

Plot[L[t] /. Equation1, {t, 0, 0.1}]

which gives

enter image description here

Cheers, Marco

POSTED BY: Marco Thiel

Okey, thanks a lot! But now a new problem arose... This expression is actually a rewritten formula derived from the characteristics of an electromagnetic railgun. The railgun fires a projectile, the L being distance from the start point at a time t, the velocity of it at that time is the L' and so on... But how can the L be linear? and the velocity negative at some instances? It does not make any sense.. Can anyone help? It might be that Mathematica does not understand the t in this part:


maybe Mathematica does not understand that t is the time, just a new variable since it is not in []? Thanks a lot Mattias

Dear Mattias,

no that is not the problem, I believe. I think that Mathematica treats your equation quite correctly. The solution looks rather straight because of your parameters. If you use different parameters:

Equation1 = 
     t] == (((0.1*4 ?*10^-1*
          L[t]*(440*Exp[1]^(-0.001 t/(0.5*0.0025)))^2/
           ?)*(0.01^2 + (L[t]^2 - L[t]*Sqrt[0.01^2 + L[t]^2]))/
         Sqrt[0.01^2 + L[t]^2])/0.01), L[0] == 0.1, L'[0] == 0.01}, 
  L, {t, 0, 0.1}]

looks not that linear anymore:

enter image description here

I think that for your parameters the straight line is a good approximation in your domain, but the result is strictly speaking not a straight line.

Cheers, Marco

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract