MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

How can I break a string into substrings of a given length and store the substrings into a list.



my string is `i love going to the movies`;

and i want the substring size to be 2

so my list L would look something like this


L = [[i ],[lo],[ve],[ g],[oi],[ng],[ t],[o ],[th],[e ],[mo],[vi],[es]]



I try to find the Maximum of the function F1 under some linear constraints with the NLP-Solve command. In the NLP-Solve command I set assume= nonnegativ and the range of the variable y[2]
is given by y[2]=[0..4.9999].
The porblem is that NLP-Solve finds the maximum at
x[2] = 6.33333333333333392, y[2] = -2.22044604925031308*10^(-16)
y[2] is nearly zero, but it is negative an so it is not in the domain of F1. How can that happen if I set  "assume=nonnegativ"

Hi , every one! Now I use the maple12 and feel it convenient to work with execpt that when I open the procedure by maple10 on another computer, the procedure become messy code? what can I do with this? Is there any direct way to do this without rewrite the procedure?  many thanks!

The concrete procedure is as follows:

PDE := diff(u(x,t),t)+diff(u(x,t),x)=0;  IBC := {u(x,0)=x,u(0,t)=0};

pds := pdsolve(PDE,IBC,numeric,time=t,range=0..0.1);

pds:-plot3d(t = 0 .. .1, x = 0 .. 1, axes = boxed, orientation = [-110, 60], color = [0, 0, u]);

and the greatest number in the graph is over 4,500. I do not understand why the number is so high?  The former PDE and the initial value are very small.   many thanks!


legend ON plot?...

April 20 2009 Scimann 511

Is there a way to have a legend on a plot? I knonw we have legendstyle=s move the legend around the plot, but it is often so much nicer to place the legend onto the unused area of the plot. I read it somewhere it was not possible, but my source could well be ancient. If not, any convenient adoptations of textplot for this task?

How do I quickly paste and copy the path to my file or working directory? For example, in R:   IN: > getwd(); OUT: [1] "C:/Program Files/R/R-2.8.2/bin". What's the Maple equivalent for that, if any? How do I set/change a working directory? Thanks.

RandomVariable(Geometric(1/p))+1; ProbabilityFunction(%, j) - FAIL. Adding one is a legitimate way to get a zero truncated geometric distribution, having a simple prob. function. Is there a way to make maple understand that? Why does it fail? Thanks.

What's the easierst way to show (with maple) the integral below evaluates (for alphas, betas>0) to the expression given after it? Thanks.

First of all I must say that I am not particulary impressed by the regression commands (fit and LeastSquares) in Maple.

I find them complicated and I must say quite annoying. You have to have the data in this format, you cannot do that...bla bla bla


I need to maximize this function:

f := proc(x::Array)
>   if (x[1]^2+x[2]+x[3]+x[4] < 15 and x[1]^2+x[2]+x[3]+x[4] > 10) then
>      2*x[1]^2+3*x[2]+4*x[3]+2*x[4];
>   else
>      1/x[1]+x[2]^2+x[3]+x[4]^2;
>   end if;
> end proc:  

here is the constraint:

> b1:=add(x[i],i=1..4) <= 20;

and initial point:

> initPoint:=[seq(x[i]=1,i=1..4)]:

command for optimization:

Dear experts, I am using Maple 11 and I am using Appel OS. Currently I try to find out how I can export Data to Excel (Apple Version). I used the example in the Maple help desk: R:= Array(1..3,1..4,[[1,2,3,4],[5,6,7,8],[9,10,11,12]]); with(ExcelTools): Export(R, "Employees.xls","Payroll", "B2"); Unfortunately I did not find a saved file on my computer called employees.xls, so obviously it has not been saved. And there was also no pop up in Maple asking me for the exact saving place. It would be of great help if you have an idea how I can handle the problem!

Is there anyway to get maple to show how the bounds of integratioin are changed from cartesian to polar?

<p>Dear all:</p>
<p>  I tried to plot contour of x^2 + 5*y^2 and two solid points. However, the option SYMBOL(_SOLIDCIRCLE) does not seem to work. Does anyone know how to fix this? Also, I am wondering how to plot a line with arrow head (direct line between 2 points) in maple?</p>
<p> </p>
<p>f:= x^2 + 5*y^2;<br />
cf :=contourplot(f,x=-15..15,y=-15..15,contours = 15,scaling = constrained):</p>
<p>plots[display](cf, POINTS([7, 9],[5, 5],SYMBOL(_SOLIDCIRCLE)));</p>
<p> </p>
<p>Many thanks,</p>


April 18 2009 natalie_g 64

1. Write a procedure to implement this function:
p(n)= x^n – 2^x cos(x), if n<5
nx + arcsin(x), otherwise.
2. Plot two functions in Q1, when n=2 and n=5, both when x is in the interval [0, 5].
3. Write a procedure to implement:
Input: 1-dimensional Array: X
Output: X’s mean and variance
You should use two output params to store “mean” and “variance”.


1. Write a do loop to store the first 50 Fibonacci numbers in a 1-dimensional array:
 A_Fib. (p.s. F(n)=F(n-1)+F(n-2), initially, F(0)=0, F(1)=1).
2. Write a linear transformation of A_Fib in Q1: B_Fib=2*A_Fib+5.
3. Use the procedure in Q5, to calculate the mean and variance of B_Fib in Q2.



**I can't use Maple shortcuts like "sum" to sum up all the numbers in a sequence, etc. **

First 774 775 776 777 778 779 780 Last Page 776 of 1070