Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.6K Views
|
9 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solve two simultaneous differential equations using W|A?

Posted 5 years ago

In need a solution of the two simultaneous differential equations:

dy/dt = 0.2 y(t) f(t) – 0.05 y(t) 
df/dt = - 0.05 y(t) f(t)                                      
with y(0) = 0.00001 and f(0) = 0.9999

I tried the Euler method provided by WolframAlpha Pro Premium: Input :

use Euler method dy/dt = 0.2 y(t) f(t) – 0.05 y(t), df/dt = - 0.05 y(t) f(t), y(0) = 0.000012, f(0) = 1.0, from 1 to 180  

output : Interpreting as:

dy/dt = 0.2 y(t) f(t) - 0.05 y(t)

The program accepts one differential equation only and a solution is provided in the form of an integral equation. The same happened with the Runge-Kutta method. Can anybody help me to find the error ? Is the syntax wrong ? Or is there a principal missunderstanding ? I am sorry, I just started to use Wolfram. Ernst

POSTED BY: Ernst Hoinkis
9 Replies

Check here for more details: https://www.wolfram.com/cloud/ It has a button "Sign up for free access".

Alternatively, go here: https://www.wolfram.com/programming-lab/

Then use the "Start programming now (no sign-in required)" button. That should take you to: https://www.open.wolframcloud.com/env/wpl/GetStarted.nb?funnel=WPLExplorations#sidebar=explorations

Now position your curson below the "2+2", enter input, and use <shift-enter> to evaluate it.

POSTED BY: Daniel Lichtblau
Attachments:
POSTED BY: Hans Dolhaine
Posted 5 years ago

Hi Daniel. Referring to your post: "In which case you might want to try it in the free version of the Wolfram Cloud", is there a free version of the Wolfram Cloud(Mathematica)? I could only get a 14-days trial.

POSTED BY: Yu Cheng Lim

Hallo Daniel, Hans's Code runs perfectly with Mathematica. Thank you very much and best regards ! Ernst

POSTED BY: Ernst Hoinkis

Hallo Herr Dolhaine ( oder einfach Hans), Ihr Programm läuft mit Mathematica. Herzlichen Dank ! Bleiben Sie gesund und Grüße aus Berlin ! Ernst Hoinkis

POSTED BY: Ernst Hoinkis

Hello Ernst,

I was just typing an answer to you when Daniel's post appeared. I wanted to say the same.

And as far as I know you can download a (free) test-version of Mathematica which runs a month or so.

POSTED BY: Hans Dolhaine

Quite possibly the Mathematica command is too long for Wolfram|Alpha. In which case you might want to try it in the free version of the Wolfram Cloud (a simple web search should suffice to locate this resource).

POSTED BY: Daniel Lichtblau

Dear Mr. Dolhaine, thank you very much for your effort to address the problem. I have tried to run your program, however, unfortunately without success. I wonder wether I am using a suitable compiler, because often the comment appears: WolframAlpha does not understand your query. During my professional life I used Fortran IV, but times have changed, and I am now an absolute beginner. I would be most grateful if you would consider the query again. Sincerely Yours Ernst Hoinkis

POSTED BY: Ernst Hoinkis

May be that an analytical solution exists, or perhaps not. But a numeric approach is possible

lsg = NDSolve[
   {D[y[t], t] == 0.2 f[t] y[t] - 0.05 y[t],
    D[f[t], t] == - 0.05 y[t] f[t],
    y[0] == 0.00001,
    f[0] == 0.9999},
   {y, f},
   {t, 0, 250}];
fy = y /. Flatten[lsg];
ff = f /. Flatten[lsg];
Plot[{fy[t], ff[t]}, {t, 0, 250}]
POSTED BY: Hans Dolhaine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard