Items tagged with programming programming Tagged Items Feed

Dear all,

I have a question regarding the computation speed of Maple. I'm doing some numerical work with Maple and when I'm not using the build in Maple routines, but write my one routines to solve e.g. a system of partial differential equations using a finite differencing method, it takes Maple sometimes up to two hours to finish the computation. I also noticed that Maple is only using around 30% of my CPU. I know it's more efficient to do numerical work with C++ or other programming languages (at least that's what most people I know are using) but do any of you know some ways to improve the computation speed of Maple or to make it use more of my CPU to do the calculations faster?

1.  a procedure quadsumstats whose input is an integer n. This procedure should return a list of length 

n whose kth  entry is the number of solutions to
x^2 + y^2 = k 
for
1 <= k and k <= n

I am sort of confused as to how to construct that list of length n and how to obtain integer solutions to the equation in maple.

2.

a procedure firstCount(k) that finds the first integer
n
with
k
representations as
"x^2+y^2= n." What does it mean for an integer to have k representations?

 

 

 

 

I need to write a procedure that does the following :

Write a procedure quadsum whose input is an integer n and whose output is a list of pairs of solutions [x,y] to the above formula.

Your procedure should implement the following algorithm.

1 Initialization
Set
"mylist = []."

Start at
x = 0
and
y = 0.

2 Phase A
Increment both
x
and
y
until
"x^2+y^2 >=n."

Phase B
Repeat the following until
x^2>n

If you are above the circle
x^2 + y^2 = n
then go down in unit steps until you are on or below the circle.

If you are on the circle, add the point to the list
"mylist. "

If you are on or below the circle
x^2 + y^2 = n
then go one step to the right. My procedure is as follows: but it runs into an infinite loop(most probably because of the while loop defined inside the while loop). What am I doing incorrectly?

I have atta

 

hello,

i am quite new into programming and i need help with writing a code that determines the largest integer in the list...

Please help..

Thank you 

The algorithm that I need to replicate is as follows:

real function f(x,y)

integer n; real a,b,c,x,y

f<-max(|x|,|y|)

a<-min(|x|,|y|)

for n=1 to 3 do

b<-(a/f)^2

c<-b/(4+b)

f<-f+2*c*f

a<-ca

end for

end function f

How can I define f,a as  functions that I am later using as variables(in f=f+2cf,b=(a/f)^2)? also, is n just a variable for iteration? 

 

In this work we show you what to do with the programming of Embedded Components applied to graphics in the Cartesian plane; from the visualization of a point up to three-dimensional objects and also using the Maple language generare own interactive applications for touch screen technology in mobile devices techniques. Given that computers use multicore and designed algorithms that solve calculus problems with very good performance in time; this brings programming to more complex mathematical structures such as in the linear algebra, analytic geometry and advanced methods in numerical analysis. The graphics will show real-time results for the correct use of the parallel programming undertook to bear the procedural technique is well suited to the data structure, curves and surfaces. Interaction in a single graphical container allowing the teaching and / or research the rapid change of parameters; giving a quick interpretation of the results.

 

FAST_UNT_2015.pdf

Programming_Embedded_Components_for_Graphics_in_Maple.mw

Atte.

L.Araujo C.

Physics Pure

Computer Science

 

 

 

Dear Maple users,

My problem is as follows:

I have a factor base [2,3,5,7,11,33,34,35,36,37,38,39,40]

The numbers from 2 till 11 are primes, the rest is not. 

Then I have to factor (H+c1)(H+c2) in numbers of the factor base , where c1 and c2 go from 1 to some pre-defined limit. H=32 in my case.
And then I have to put the powers of the numbers of the factor base in a matrix. For example: (H+1)(H+1)=33² but also (H+1)(H+1)=3²*11².

That will become in matrix form [0 , 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0 ] but also (!) [0 , 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0 ].

This is not what I want! I want no double representations....

What I want is that (H+c1)(H+c2) should be represented in primes in the matrix if possible and else just represented as the other numbers.

 

hope you guys can help me!

Hello

I have a loop with the do structure but there is an error in the loop .

how can I continue the loop by error or disregard it?

How can error of invalid range be corrected FDM.mw

The Embedded Components are containers that currently use industries for modeling complex systems to find viable solutions in real time and thus avoid huge wait times and overload our computer; by this paper should show you how to implement a dynamic worksheet through Embedded Components in Maple; it goes from finding solutions to ordinary differential equations partial; which interact with the researcher using different parameters.
Using graphical programming will find immediate solutions to selected problems in science and engineering criteria of variability and boundary conditions evolving development with buttons on multiple actions.

 

cimac_2014.pdf

(in spanish)

Solutions_of_Differential_Equations_with_Embedded_Components.mw

 

Lenin Araujo Castillo

Physics Pure

Computer Science

 

I read this, but there was nothing on how to write a help associated with it.

Does anyone know where I can find it?

 

Many thanks,

 

casperyc

Hello,

I am very new to programming and currently i am taking a course in numerical methods which allows me to get some exercise programming mathematical functions using maple. I am trying to plot a graph and it gives me an error. If anyone can guide me i would really appreciate it.

Also if there are any helpful advise for me to start using this language, it would be a big help.

 

Thank you

a:=rand(0..8):
b:=rand(0..8):
c:=rand(0..8):
d:=rand(0..8):
e:=rand(0..8):
f:=rand(0..8):
a()+b()+c()+d()+e()+f()=8;

This is my  programming code.

I want ot set six random summation is  8. 

But the random summation can't reach 8.

I have a Maple program that fits a nonlinear function with 9 parameters to a dataset that contains multiple records; each record gets fitted separately. The records are ordered by a certain experimental variable (an angle of a target). The initial parameters for each fit are the solutions of the previous fit; in this case I get relatively good initial estimates and not too much trouble fitting. I use Statistics:-NonLinearFit to do the actual fitting.

Since this is a bit time consuming and I need to do this a fair amount of times, I'd like to see if I can't speed his up by employing parallel programming.

One way to speed up a fit is to compute the sum of residuals in parallel; is there a way to do this in Maple?

Another way would be to run several fits at the same time. The problem I have with that in this case is that I use the results of the previous fit as starting values for the next fit. I might be able to increase the stride of this scheme; i.e. for 4 processes, use the result of fit 1 as starting point for fit 5; fit 2 for fit 6 etc. But before I embark on this non-trivial change; can Statistics:-NonLinearFit even be used in this way (i.e. is it thread safe)?? My fitting function is an actual function (as opposed to a procedure with local variables) so I don't think the function itself would cause trouble.

I could also contemplate the Grid package; except that I am concerned about the overhead moving the data over to each node (although it would all sit on one machine with 4 processors).

I realize that I may have to do some experimentation by myself, but if there is any experience out there I'd like to know about it...

Mac Dude

I see a document with maple graphics in it, but i don't see the maple code in the document.

Has the author protected his code ?
I like to see the maple code used for the document ..how to read this maple code?

Note: try to find answer on the Maple site , but no idea where to find thisinformation on how to set up a document..frustrating.  
 

1 2 3 4 5 6 7 Page 1 of 7