Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I encountered a problem with a simple subs in Maple 15.01:

Q:=1/(a*l);

subs(a*l=t,Q);

This fails to perform the substitution and gives 1/(a*l) instead of 1/t.

However, it seems to work in certain form, for example:

Q:=exp(a*l);

subs(a*l=t,Q);

produces exp(t) correctly.

Furthermore,

Q:=1/(a*l)*exp(a*l);

subs(a*l=t,Q);

gives exp(t)/(a*l). Strangely, the substitution in the exponential is correct...

I am trying to maximize a non-linear function f with respect to variables {a,b}.

Could any one suggest a smarter way of entering this into Maple please, as I am not able to get an answer.Thank you.

The function (shown below) also has the parameters {c,H} in it and I have the constraint:

CONSTRAINT:______________0

My Function f:

(256 a^4 (4 c - H) + (1604 c - 10385 H) H^4 -
   60 b^3 H (56 c + 177 H) + 6 b^2 H^2 (-708 c + 1663 H) +

Hi,

I'm trying to use powsolve to give me the power series of a differential equation. It's been working wonderfully, afaik, but once I put in exp(x) it refuses to run. Here's my code:

 >with(powseries);

>a := powsolve(diff(y(x), x, x)+y*exp(x) = 0, y(0) = 1, (D(y))(0) = 2); tpsform(a, x)

 

and the error I'm getting:

Error, (in powseries:-powsolve) final value in for loop must be numeric or character
> restart; with(DEtools);
> ED1 := diff(y(x), x) = sen(y)+cos(x);
print(`output redirected...`); # input placeholder
d
--- y(x) = sen(y) + cos(x)
dx
> dfieldplot(ED1, y(x), x = 0, y = 0, title = `Ejemplo 1`, color = sen(y)+cos(x), arrows = almit, title = figura*(diff(1, x)));
%;
Error, (in DEtools/dfieldplot) invalid range for independent variable

My list of problems solved with Clickable-Calculus syntax-free techniques now numbers 154, spread over eight subject areas. Recently, Maplesoft posted to its website 44 of these problems, along with videos of their point-and-click solutions. Not only do these solutions demonstrate Maple functionalities, but they also have a pedagogic message, that is resequencing skills and concepts. They show how Maple can be used to obtain a solution, then show how Maple can be used to implement...



See attached.  I have stared at this long enough to the point I need some FRESH eyes on this.  Why does MAPLE return FALSE on the last 2 statements

Solve the equation y"-4y=lnx ?

                                     

Hello!

if anyone can help ill be greatful!.

i have his equation:

eq1:=(8/x)=tan(7*x/50)

of course  there are infinite analitical solutions....   solution = F(x)+Pi*n, n=1....infinity

what i want to do, is to define N. and then,  to put the first N solutions of the equation into a Vector called X,

so X[1]=F(x)+1*Pi

X[2]=F(x)+2*Pi

...

X[N]=F(x)+N*Pi

can someone help?

When exporting plots some labels are occasionally cropped. This is true when exporting via the context menu or with plotsetup('gif', etc.) for instance (plotsetup also drops the third label in 3D plots, the context menu keeps it).

I discovered that scaling the plot from the context menu can help: is there a programmatic way to control the plot scale?

From the context menu: Manipulator -> Scale, the plot can be rescaled to ensure that all...

Hello,

i want to solve the following for q[b], theta is a symbolic coefficient. When I use the solve command it produces a RootOf that i cannot handle by using either allvalues or evalf. I can't use fsolve since there is theta 

In the previous question, we discussed a workaround for evaluating a multi-variable integration. 

For the following example 

> g := (e1, e2, e3) -> piecewise(e1+1.200000000 <= e2 and e3-2.400000000 <= e1, evalf(64.00000000*exp((-1)*8.000000000*e1^2)*exp((-1)*8.000000000*e2^2)*exp((-1)*8.000000000*e3^2)/Pi^2), 0);
>
> evalf(Int((x, y, z) -> g(x, y, z), [-2 .. 2, -2 .. 2, -2 .. 2]), 3);
Maple could start execution and do the computation.

Someone asked me the other week whether a color gradient could be easily applied to a high density point-plot, either vertically or horizontally graded.

Without thinking, I said, "Sure, easy." But when I got to a computer, and gave it a little thought, I realized that it's not that easy to do it efficiently. And it really ought to be, even for tens of thousands of points.

There is a help-page plot,color which briefly describes some things that can be done with coloring plots. As of Maple 16, it mentions a "color data structure" which can be created by calls to the new ColorTools package. There is an example on that page for a single color, but not for several colors concurrently. Using Colortools to get a list of colors, for many points, can be done. (And there ought to be such an example.) But for the case of many data points that uses quite a lot of memory, and is slow.

Also, there is no 2D plotting equivalent to the 3D plotting colorfunc functionality. There ought to be. And just as the 3D colorfunc should be fixed to take three arguments (x,y, & z) any new 2D colorfunc should be made to take two arguments (x & y).

So, how can we apply a color gradient on a 25000 2D-point-plot, shaded by y-value? One way is to notice that the various 2D and 3D plot data structures can now store an efficient m-by-3 (or m-by-n-by-3) C_order, float[8] Array for the purpose of representing the chosen colors. (That is not documented, but can be learned by observation and inspection of various example plot structures.) We know that such an Array is relatively memory-light, and can be produced very quickly.

What this task has become is a 2D version of this method of inserting a custom made color sequence into a 3D plot, but more efficient on account of using a float[8] Array.

To get some decent timings the attached worksheet uses the time[real] command. Timings are computed both immediately after computation (same execution block) as well as after plot rendering (next execution block).

It takes about 1 sec for the Maple 16.01 64bit Standard GUI on Windows 7 to throw up and render the plot, for both methods.

It takes 3.4 sec, and a 108 MB increase in allocated memory, to compute the plot data structure result using ColorTools and a list. But it takes only 0.45 sec, and a 20.5 MB increase in allocated memory, to compute an equivalent plot data structure using the float[8] Array. (Timings on an Intel i7-960.)

[worksheet upload is misbehaving. So inlining the code.]

restart:
N:=25000:

xy:=LinearAlgebra:-RandomMatrix(N,2,generator=0.0..1.0,
                                outputoptions=[datatype=float[8]]):

str:=time[real]():

plots:-pointplot(xy,
                    color=[seq(ColorTools:-Color([xy[i,2],0,0]),i=1..N)],
                    symbolsize=4);

time[real]()-str;

                             3.323

time[real]()-str; # in new execution group

                             4.400
kernelopts(bytesalloc);

                           107646976


restart:
N:=25000:

xy:=LinearAlgebra:-RandomMatrix(N,2,generator=0.0..1.0,
                                outputoptions=[datatype=float[8]]):

str:=time[real]():

p:=plots:-pointplot(xy,color=red,symbolsize=4):

c:=Array(1..N*3,(i)->`if`(irem(i,3)=1,xy[(i+2)/3,2],0),
         datatype=float[8],order=C_order):

subsindets(p,specfunc(anything,COLOUR),z->'COLOUR'('RGB',c));

time[real]()-str;

                             0.483

time[real]()-str; # in new execution group

                             1.357
kernelopts(bytesalloc);

                            20545536

When an integration is successfully evaluated numerically, a float number is returned, otherwise the unevaluated expression is returned. I'm wondering whether Maple has a utility function which simply takes in whatever the integration evaluation gives and return a boolean flag indicating whether it is unevaluated or is a floating point result? 

Hi, I got a problem that "Warning, solutions may have been lost" when I solve 

eqns := {a+r*t*ln(l)+(1-l)^2*m-b-r*t*ln(s)-(1-s)^2*n = 0, a+r*t*ln(1-l)+l^2*m-b-r*t*ln(1-s)-s^2*n = 0}
vars := {l, s}
solve(eqns, vars)
Why?
First 1568 1569 1570 1571 1572 1573 1574 Last Page 1570 of 2224