MaplePrimes Questions

Hi there!

Maple has lot's of datatypes which are very related to each other, such as Matrices and Arrays, or sets, lists and vectors.

Most of the time I am not quite sure which type is the "right" one to use for me, and I guess for most of the stuff I have done so far it didn't really matter. However now I am going a bit into numerics, and there things can get big and computationally expensive. Also, recently I got an error message stating that I would assign a large list to a variable, and should rather use an Array instead. So I guess I should start to bother what to use. : )

Obviously the Matrix has some advantages to the Array in the sense that I can perform matrix calculations with it easier using the LinearAlgebra package. So it can be transposed and what not. But is it disadvantegeous to the Array in any way, especially when it comes to large matrices in numerical calculations?

The same would interest me for sets, lists and Vectors.

Cheers!

Gernot

Hi there!

I want to improve the way I code up my procedures. For instance I want to code them safe in the sense that they only accept the arguments when they have the correct type.

I know that in principle this is done with the double-colon operator in the following way:

proc(argument::argumenttype)::valuetype;

 

(Q1)Now, given that my argument is of a type such as set, list, Array, etc.:

(a) How would I specify the allowed types of the elements of that list (for all elements, and for specific ones)? And if the element of the list is a list again, how would I specify the type of that's elements? and so forth..

(b) How would I specify the allowed size of the listArray, etc. ?

 

(Q2) How do I specify the types of more than one output, if my proc returns more than one value?

 

(Q3) I know that there are special integer types, such as nonnegint, posint, negint. Is there also a way to specify that the ineger (or float) argument has to be greater than some given value, e.g. >2, or that it has to lie between two values, or out of a given set?

 

Thats all for now. Thanks for your help guys! : )

Gernot

Hi.

I have two problems:

1) Start code SetProperty(Button0, enabled, true); doesn't switch the property 'Enabled' of Button0 to 'true', as I'd like it to. How to correct the code to switch?

2) I'd like the property 'Enabled' of button 'Button1' switch to 'false' immediately after it is pressed. (I put SetProperty(Button1, enabled, false); at the beginning of Action When Clicked) However Maple waits untill all code within Action When Clicked is calculated. How to correct it?

probe2.mw

I have a set of 19 different items I need randomize, lets call them A-S. I tried the Random command, Random(19,A-S) listing all of the possiblities. I want each letter to be used once in that 19 times and using this way does not do that. Is there another command I can use to achieve this?

Hello guys, pls. how can I plot the graph of the rational function below.

The numerator against the denominator. this is very strange to me and does not make sense at all.

Hi

I want to show an animation in Plot component on Button press.

Action when clicked for the button :

use DocumentTools in

Do(%Plot0 = dis);
SetProperty(Plot0, play, true, refresh=true);

end use;


Variable dis was calculated earlier:

...
B := animate(plot, [u(t, x), x = xmin .. xmax], t = tmin .. tmax, frames = n):
dis:=display(B, insequence = true):
...

However, the first press on the button gives static first frame. Only second press starts the animation.
What's the problem with my code?

Hey 

I'm trying to fit a spacecurve onto some points I have. 

I know, I can use Spline to do this in 2D, but it doesn't work in 3D.

What command(s) can I use to fit a spacecurve onto my points? 

Thanks in advance

I have to plot 4 vectors in one graph. I have the following structure:

plot(Vector([12, 12.5, 13, 13.5, 14, 14.5, 15]), Vector([1.622712644, 1.265443137, 1.028604736, .8605013333, .7352916667, .6386248233, .5618945274]), style = line, symbol = asterisk, color = blue)

and 

plot(Vector([12, 12.5, 13, 13.5, 14, 14.5, 15]), Vector([5.483608580, 4.289400489, 3.496793877, 2.933480578, 2.513320599, 2.188469637, 1.930230220]), style = line, symbol = asterisk, color = blue)

Could you help me to plot these two curves in one graph.

 

please help me to find a solution for this issue...

I would like to thank you in advance

Best regards,

D.L.

Hi, I have encountered a difficult question.

 

My answer is A=151,B = 47.

Could anyone tell me whether this answer is correct?

 

The question is as follow:

Pi=∑((120n2+An+B)/(16n((512n4 + 1024n3 + 712n2 + 194n + 15))  (n starts from 0 to infinity)

 

Thanks in advance.

Hi,

I need to solve following problem, but i m facing memory allocation problem in code. I dont know where memory is consuming.

Download nonlinearx.mw

Thanx in advance.

Regards

Sunit

Hi,

I'm trying to stop integration if the numeric procedure takes more than ~2 seconds and set the value to zero. As an example consider

restart;
st:=time():
answer:= evalf( Int(SphericalY(161,5,x,5)*SphericalY(262,5,x,x), x=0..10));
t:= time()-st;

This takes 0.63 seconds on my computer, but I wish to stop it after 0.1 seconds as an example. Is there anyway to access the inside of evalf(Int...)) and kill it after 0.1 seconds?

thanks,

The question is to solve

x^2*(diff(y(x), x, x))+x^3*(diff(y(x), x))+(x^2-2)*y(x) = 0

and evaluate it where y(1) = 1 and y(2) = 2 to find y(3).

 

When I do the equation,

 

ODE := x^2*(diff(y(x), x, x))+x^3*(diff(y(x), x))+(x^2-2)*y(x) = 0

dsolve(ODE) y(x) = _C1/x+_C2*(-sqrt(Pi)*sqrt(2)*erf((1/2)*sqrt(2)*x)+2*x*exp(-(1/2)*x^2))/x

 

I have gotten an erf. Is this correct?

Hi everyone,

I need to write a program to save some files in both Windows or Unix System.

The structure of the path files is different from windows to Unix, so i want to something like this

if (WindowsOS) then

        pathFILE := "\\MyDirectory\\blabla.txt";

elif (UnixOS) then

       pathFILE := "\/MyDirectory\/blabla.txt";

end if;

 

Thanks for help.

Hello, 

I am trying to plot an equation with mape,

I give the foloowing comand but I receive a warning which I do not know how to deal with it, I wil be thankful if you can help me.

these are the command and wanring:

plot(eval ((6), {n=10, m=1},k=0.1..0.2)

warning, expecting only range variable k in expression.....

 

I am trying to use Maple17 to create practice integration problems in which the integrands contain square roots.  I want the students to practice converting square roots, perhaps with fractions, to fractional and/or negative powers.  Hopefully Maple can typeset the integrals if I use the inert form "Int", and also do the integrals for me so I can find the answers quicker than doing it by hand, and not have to worry about making a careless mistake.  The trouble is, Maple is converting the square roots to fractional exponents:

Download DisplaySquareRoot.

Download DisplaySquareRoot.mw

I hope at least one of these works.  To make a long story short, when I display an integral using "Int", how do I prevent Maple from converting square roots to fractional exponents?

 

GS

 

 

First 1507 1508 1509 1510 1511 1512 1513 Last Page 1509 of 2433