PatrickT

Dr. Patrick T

2153 Reputation

18 Badges

16 years, 206 days

MaplePrimes Activity


These are questions asked by PatrickT

I would like to export-to-file a list containing equations, variables, and constants, e.g.

xyz := [dx = x*y-(1/3)*(y-z), dy = -0.01*x, dz = z/10];
I have used fprintf to write to a file. The closest I got to what I want is by doing:
fd := fopen("xyz.m", WRITE) :
fprintf( fd, %s,  CodeGeneration[Matlab](xyz,'output'=string) ):
fclose(fd) :

Using CodeGeneration[Matlab] was the only way I found to export a list like xyz above, simply writing fprintf...

I have simulated 50 trajectories of an ODE system, with  a command roughly like this:

myPlot :=
 seq( plots:-odeplot
    ( Sol(i)
    , [ u(t), r(t), q(t) ]
    , t = T .. 0                          ### Time Run Backwards
    , 'numpoints' = 2*abs(T)
    )

Is this the best way to extract the argmin with "minimize"? Thanks for your suggestions.

minimum := minimize( x^2, x = -1 .. 1, 'location' = true );
y_min := minimum[1];
x_argmin := rhs(op(op(minimum[2])[][1]));
                       0, {[{x = 0}, 0]}
                ...


How would you transform a 3D plot structure into a 2D plot structure? I have in mind 1) creating a 3D plot with odeplot or with plot3d, 2) selecting (say) 4 orientations, 3) transforming each into a 2D plot, 4) exporting the 2D plots using the Standard GUI.

The reason behind my question is that the best-looking exported plots that I have been able to obtain with Maple are 2D plots exported as postscript with the Standard GUI. 3D plots don't look nearly as good when...

I have written lists of parameter values and functional forms which I read at the top of the worksheet and use subsequently when I need numerical output.

For instance,

Parameters1 := [ s = 2 ];
Functions1 := [ U = 'proc(c) (c^(1-s)-1)/(1-s); end proc' ];
eval(eval(U(c), Functions1), Parameters1);
                             ...
2 3 4 5 6 7 8 Last Page 4 of 13