gabrielmp

5 Reputation

2 Badges

12 years, 201 days

MaplePrimes Activity


These are questions asked by gabrielmp

Hi guys. I need to do a Runge-Kutta method to solve two equations and I'm having trouble at using functions. My program is as shown below:

restart; A := Matrix();

dt := 0.1e-2;

diff(x(t), t) := v;

diff(v, t) := a(x(t), v);

xo := 0; vo := 0;

for i to 1000 do

xn := xo+v.dt;

vn := vo+a.dt;

dx1 := vn.dt; dv1 := a.dt;

dx2 := (vn+(1/2)*dv1)*dt; dv2 := a(x(t)+(1/2)*dx1, (1/2)*dv1)*dt;

dx3 := (vn+(1/2...

HI folks ! I'm new to this forum and I have a problem with the Euler Method to solve equations.

In the method, there are 3 variables, x, v and t. I need to save the result from every step from the method of the 3 variables and then create a matrix with 3 columns (one for each variable) and any amount of lines.
Is is the best way to do it ? I'm having a lot of trouble at storing data into vectors. 

To clarify my problem, here is my program:

Page 1 of 1