MaplePrimes Questions

Hi all,

I google and found a program using C# connect with Maple. The Maple file is mla file - a pakage library type of Maple. I want to review data structure and all interfaces funtions to understand the way to implement this features.

Please help me the way to read the original Maple code. I uploaded the .mla file into mediafire if you want to review it. Link http://www.mediafire.com/download/abd9kpk3q6oq8lb/CHEMISTRY.mla 

Regards,

Quan Nguyen

Hi there,

I'm trying to simulate an stochastic SIR model following the Gillespie algorithm, as described here [1].

 

When trying to update each process' probabilities, it looks like Maple is not updating their values. Although each element of the lists S, I and R is updated the ai lists are not updated.

For example, for a given index i

a2[i]:= m*S[i]:

takes the same value for every i, regardless of the value of S[i].

Can anybody tell why this is happening or what's wrong with the worksheet? This is the attempt: MaplePrimes_SIR_model_simulation_Gillespie_algorithm.mw

 

On the other hand, I tried making things more clear through a couple of procedures. However, when it comes to the point where a random number with an exponential distirbution is computed:

Rexp := RandomVariable(Exponential(mu)):

it looks like Maple is unable to evaluate mu. But having a look at the Variables explorer, it has a defined value, indeed.

So what's wrong in the worksheet? Thi is the attempt: MaplePrimes_SIR_model_simulation_Gillespie_algorithm.mw

 

Thanks,

jon

[1] http://www.biosym.uzh.ch/modules/models/ETHZ/StochasticSimulation/sir_stoch.xhtml

Hi every one.

I want to export some plots from maple as images in ".jpg" or ".png" formats. I was wondering that is there a way to specify the resolution of the exported pictures? I need high quality pics.

I just bought Maple Student edition. I won't allow me to validate myself and won't allow me to install the software unless I remove Java 8 and install the much older Java 6?!

Please help.

Hi! when i'm trying to solve, i get the following warning: Warning, solutions may have been lost.

The equations i'm trying to solve are as the following:

>A=0.1;

> D=0.19;

> eqns:={y^1.5-9/8*B^0.5*y+3/4*x*y^0.5-3/4*(Pi/3)^0.5*[1+(1+3/4*(Pi/3)*(B*(1+x^2))^0.5)*x^2]/(1+x^2)^0.5=0, Pi/2-3*D=8/3*y^3+x*y^2+4*B^0.5*[1/3*B*y^1.5-2/45*B^2.5-3/2*y^2.5]-9/2*B*(1/3*B*y-3/40*B^2-3/4*y^2)-3*x*B^0.5*[1/3*B*y^0.5-1/7*B^1.5-1/2*y^1.5],B=A/(1+x^2)};

> vars:={x,y,B};

> solve(eqns,vars);

Warning, solutions may have been lost

What am i doing wrong?

Many thanks!

Hi, all

I use INT to calculate multiple integration as below. It runs more than 20 hours without results. I wander is there any problem in my codes.

restart;
A := sin(k*Pi*(x-h*cos(theta))/a)*sin(l*Pi*(y-h*sin(theta))/b)*sin(k[0]*h)*sin(k*Pi*x/a)*sin(l*Pi*y/b);

W := evalf[5](int(int(int(int(A, h = 0 .. (x-a)/cos(theta)), theta = Pi+arctan((b-y)/(a-x)) .. 3*Pi*(1/2)), x = 0 .. a), y = 0 .. b, numeric))

 

Thanks

Why the disparity in the solution of P1 and P2? P1 uses finite difference while P2 uses midrich.

See them here P1.mw     and   P2.mw

Hi,

 

  Suppose I would like to use writedata for a series of files, e.g. test1.txt, test2.txt, test3.txt.  

I tried

***

a_min:=1;a_max:=3;
b_min:=1;b_max:=3;
A:=array(a_min..a_max,b_min..b_max);


for i from a_min to a_max do
  for j from b_min to b_max do 
     A[i,j]:=i*j;
  end do;
end do;

for i from 1 to 3 do
  file_name:=`test||i`;
  writedata[APPEND](file_name,A);
end do;

****

Seems "||" inside `` does not work, is there any robust solution for this issue? 

 

Thank you very much

 

I am trying to define a new typt and I am beating my head against the wall...

What I have working:

TypeTools:-AddType(Element,'record(l,R)');
 
This defines a type which I can then use in type(xpr,Element) to be false or true depending on whether xpr is a record containing (at least) entries l and R or not.

Now I want to define a type ExpandedLine that is a Vector of Element (Element in the sense above). In fact, in the context of my application I am willing to settle for ExpandedLine being a Vector of record.

Tried various approaches (and making sure Vector is in uneval quotes in the AddType statement) like:

TypeTools:-AddType(ExpandedLine,'Vector'(record));

and variations but no luck.

Any help is appreciated.

Mac Dude

 

I want to put the solution obtained from ShowSolution() command of Student[Calculus1] into my LaTeX file. How I can achieve that?

I succeeded in getting latex of ExpandSteps because it was a module, but ShowSolution() is not a module.

Hello everyone,

I have nonlinear partial differential equations (see the attached file) need to be solved:

https://drive.google.com/file/d/0B14...ew?usp=sharing

With initial condition: h(x, y) = K1 (constant), dh/dx = K2 (constant); dh/dy = K3 (constant); And h(x,y) is function of (x,y) other factors are constant. Could anyone tell me how to solve these equations by using numerical method? Do you know any library in c/ c++ language that can solve these equations??

I have tried with Maple 17 and the response is: "Error, (in pdsolve/info) first argument is not a differential equation". Whole of my input:

 

with(PDEtools); declare(U1(x, y), U2(x, y), U3(x, y));

PDEs = [diff(U1(x, y), y) = U2(x, y),

diff(U1(x, y), x) = U3(x, y),

(diff(U2(x, y), y))*((L-U1(x, y))^2+(D2+tan(alpha)*(L+U1(x, y)))^2)+.5*U2(x, y)*(2*tan(alpha)*U1(x, y)-D2) = 0,

(diff(U3(x, y), x))*((L-U1(x, y))^2+D1^2*cos(alpha+2*U2(x, y))^2)+.5*U3(x, y)*D1*cos(alpha+2*U2(x, y))+.5*D1*sin(alpha+2*U2(x, y))*(L-U1(x, y)) = 0];

 

[ d d / d
PDEs = [--- U1(x, y) = U2(x, y), --- U1(x, y) = U3(x, y), |--- U2(
[ dy dx \ dy

\ / 2 2\
x, y)| \(L - U1(x, y)) + (D2 + tan(alpha) (L + U1(x, y))) /
/

/ d
+ 0.5 U2(x, y) (2 tan(alpha) U1(x, y) - D2) = 0, |--- U3(x, y)
\ dx

\ / 2 2 2\
| \(L - U1(x, y)) + D1 cos(alpha + 2 U2(x, y)) /
/

+ 0.5 U3(x, y) D1 cos(alpha + 2 U2(x, y))

]
+ 0.5 D1 sin(alpha + 2 U2(x, y)) (L - U1(x, y)) = 0]
]

pdsolve(PDEs);
Error, (in pdsolve/info) first argument is not a differential equation

 


I will be very appreciated with your help!!!

I need to convert a base 10 int(defined as num) to its base 3 format using a while loop. I would like to store the remainder of the num%3 to a list/sequence/array in maple. Now, if I were to use a sequence, I would need a pre-defined range. How do I solve this issue?

I've got a piece-wise function(for which I've made the procedure) f defined over x<=-1, -1<x<1 and x>=1 which I am trying to plot over the range of (-2,2). I've tried using plot(f,-2..2) but it doesn't show any curve. Should I add a few more parameters to plot()?

I've got the following lists :

list1:=[1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, 650, 819, 1015,

1240, 1496, 1785, 2109, 2470, 2870]
list2:=[1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, 650, 819, 1015,

1240, 1496, 1785, 2109, 2470, 2870]

each generated by a procedure I defined. I need to verify that they are equal, which is the case. However, when I tried to use the evalb function as well as a flag that I was updating during a loop, in both cases, I got 'false' as  the answer along with the error message: 

"error, final value in a for loop must be numeric or a character"

What I am doing wrong?

I am required to generate a list containing the square of numbers 1 through k where k is an arbitrary int,defined from 1 to n. To do this, I've currently got the following commands:

local k, mylist:=[];

for k from 1 to n do

mylist[k]=sumsquare(k);

end do;

where sumsquare() is a procedure I defined to compute the sum of the squares of 1 through a number passed as an argument

At present this gives me an out of bounds error. 

How can I initialize mylist to be of size n, like in other languages such as C++?

 

First 1323 1324 1325 1326 1327 1328 1329 Last Page 1325 of 2429