GEEMIC

45 Reputation

3 Badges

4 years, 215 days

MaplePrimes Activity


These are questions asked by GEEMIC

I would like to emphasize a particular region of my plot by shading the whole strip between x=0 and x=1. I learned of the command shadebetween, but the functions it takes as arguments for the boundaries of the region to shade must be functions of x.

Does someone know how to shade between two vertical lines?

I am trying to plot the solution of the following complex-valued initial value problem (IVP), obtained numerically with dsolve:

odesys := {dy(x)/dx + I*y(x) = 0, y(0) = 1};

sol := dsolve(odesys,numeric,range=0..1);

In the Maple help page dsolve/numeric, they say that dsolve can solve complex-valued IVPs. When I try the code above, it seems to work (I don't get an error). But I can't find how to plot the real and imaginary parts of y(x). Indeed, odeplot(sol) yields an empty graph, and odeplot(Re(sol)) yields an error.

Does someone know how to do this? Thanks in advance for your help.

I have an expression of the form

Expr := n0*C[0] + n1*C[1] + ... + nk*C[k] + n = 0,

where the numbers n0,...,nk and n are known to Maple (after it made some calculations), whereas C[0],...,C[k] are undetermined.

I would like to know the values of all of n0,...,nK and n. For n0,...,nk, I found them with 

coeff(Expr, C[m], 1),

with m in 0,...,k. But I don't know how to get the value of the "independent term" n.

Can someone help me with this?

Hello,

I am having some trouble with the "Seq" command of the "Threads" package. This is a parallel implementation of the usual "seq" command.

I namely defined a (very long) procedure "f" which defines a (very complicated) function $f: R^2 -> R$, taking as arguments an $x$ and a $y$ and returning $f(x,y)$. I want to plot its graph in 3D, which I try to do by making a 3D data structure consisting of points making up the $x$ range, $y$ range, and the evaluations $f(x,y)$. I then want to plot it with the "SurfacePlot" command from the "Statistics" package.

If I define my data structure as

 data := [seq([seq([i/10, j/10, f(i/10, j/10)], i = 1 .. 10)], j = 1 .. 10)]

the SurfacePlot(data) works. However, it is very slow because it runs in serial and the function evaluation "f(x,y)" takes a long time to compute.

I therefore wanted to compute the data in parallel. For this, I use

 data := [Seq([Seq([i/10, j/10, f(i/10, j/10)], i = 1 .. 10)], j = 1 .. 10)]

Sometimes this works, but often it does not and I get the following error after a number of datapoints have been computed (i.e. after evaluations of f have been made).

Error, (in simplify/float) invalid arguments for Float constructor

This is the first time I use parallel computing, so I am not familiar with potential problems that could trigger errors and don't understand very well how parallel computing works. Does "Seq" only compute the different data points [x,y,f(x,y)] in parallel, or does it compute stuff within the procedure "f" also in parallel when evaluating "f(x,y)" at some fixed arguments "(x,y)"? Because another procedure is defined within "f" and it is called multiple times within one "f" call, so in that case it could be a problem with lexical scope. Any suggestion to help me understand and correct my error would be greatly appreciated.

Page 1 of 1