BeatrizSilva

10 Reputation

One Badge

0 years, 316 days

MaplePrimes Activity


These are questions asked by BeatrizSilva

Hello,

I am trying to pass the graphics to .txt format so that I can plot them in Origin (OriginLab).

npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    PA[i] := x[i](t);
    printf("%e %e\n", t[i], PA[i]);
    fprintf(fd, "%e %e\n", t[i], PA[i]);
end do;
0.000000e+00 

Error, (in fprintf) number expected for floating point format
fclose(fd);
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    PB[i] := x[i + n](t);
    printf("%e %e\n", t[i], PB[i]);
    fprintf(fd, "%e %e\n", t[i], PB[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    qA[i] := x[i + 2*n](t);
    printf("%e %e\n", t[i], qA[i]);
    fprintf(fd, "%e %e\n", t[i], qA[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    qB[i] := x[i + 3*n](t);
    printf("%e %e\n", t[i], qB[i]);
    fprintf(fd, "%e %e\n", t[i], qB[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    Tg[i] := x[i + 4*n](t);
    printf("%e %e\n", t[i], Tg[i]);
    fprintf(fd, "%e %e\n", t[i], Tg[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    Ts[i] := x[i + 5*n](t);
    printf("%e %e\n", t[i], Ts[i]);
    fprintf(fd, "%e %e\n", t[i], Ts[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format

trabalho_final_2019.mw

Hello,

Please, what is going wrong that it is not graphing the ODE system solution?

eqs := seq(eq[i], i = 1 .. 6*n);
cis := seq(ci[i], i = 1 .. 6*n);
sol := dsolve([eqs, cis], numeric, stiff = true, output = listprocedure);
for i to n do
    graf1[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = black);
end do;
for i from 11 to 2*n do
    graf2[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = blue);
end do;
for i from 21 to 3*n do
    graf3[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = green);
end do;
for i from 31 to 4*n do
    graf4[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = red);
end do;
for i from 41 to 5*n do
    graf5[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = pink);
end do;
for i from 51 to 6*n do
    graf6[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = orange);
end do;

display(seq(graf1[i], i = 1 .. n));
display(seq(graf2[i], i = 11 .. 2*n));
display(seq(graf3[i], i = 21 .. 3*n));
display(seq(graf4[i], i = 31 .. 4*n));
display(seq(graf5[i], i = 41 .. 5*n));
display(seq(graf6[i], i = 51 .. 6*n));


trabalho_final_2019.mw

Page 1 of 1