Items tagged with function function Tagged Items Feed

How can I plot a volume (many surfaces) in X,Y, Z axis where X,Y,Z are functions in 4 variables (a,b,c,d), and the domain for the 4 variables are 

-90<=a>=90, -10<=b>=10, -12<=c>=12, -90<=d>=0,


X := proc (a, b, c, d) options operator, arrow; 324.*cos(b)*sin(c)*cos(d)+324.*sin(b)*sin(d)+323.5*cos(b)*sin(c) end procX := proc (a, b, c, d) options operator, arrow; 324.*cos(b)*sin(c)*cos(d)+324.*sin(b)*sin(d)+323.5*cos(b)*sin(c) end proc

Y := proc (a, b, c, d) options operator, arrow; (324*1.*sin(a)*sin(b)*sin(c)+324*1.*cos(a)*cos(c))*cos(d)+(-1)*324.*sin(a)*cos(b)*sin(d)+323.5*sin(a)*sin(b)*sin(c)+323.5*cos(a)*cos(c)-100 end proc

Y := proc (a, b, c, d) options operator, arrow; (324*1.*sin(a)*sin(b)*sin(c)+324*1.*cos(a)*cos(c))*cos(d)+(-1)*324.*sin(a)*cos(b)*sin(d)+323.5*sin(a)*sin(b)*sin(c)+323.5*cos(a)*cos(c)-100 end proc

Z := proc (a, b, c, d) options operator, arrow; (324*cos(a)*sin(b)*sin(c)-324*sin(a)*cos(c))*cos(d)-324*cos(a)*cos(b)*sin(d)+323.5*cos(a)*sin(b)*sin(c)+(-1)*323.5*sin(a)*cos(c)+150 end proc

Z := proc (a, b, c, d) options operator, arrow; (324*cos(a)*sin(b)*sin(c)-324*sin(a)*cos(c))*cos(d)-324*cos(a)*cos(b)*sin(d)+323.5*cos(a)*sin(b)*sin(c)+(-1)*323.5*sin(a)*cos(c)+150 end proc

i want to use dictionary or hashtable in maple

the key are a function, value are a list of things


how to do?

Hi all

I have written the following code in maple to approximate arbitrary functions by hybrid of block-pulse and bernstein functions but it doesn't work properly especially for f(t)=1.0, so what is the matter?



best wishes

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

I'm used to Mathcad, and I am very new to Maple. Something I cannot figure out right now is how to define multiple elments of a matrix using a function.

Input Data

Define system dimensions as n:=2;






Minor side note: I originaly had upsilon defined using the syntax "Vector[row](ncomp)", but this was giving me an 'exponentiation' operation error, so I changed it to what it is now (basically a list/array, which I guess has different type definitions that no longer cause the error?).





The Problem I'm Having

Now I just want to define Lambda using a function to define all elements (like I would in Mathcad).

Lambda[i,j]:= (upsilon[j]/upsilon[i]) * exp (-lambda[i,j]/2853);

which gives me an extremely long error message:

Error, invalid input: exp expects its 1st argument, x, to be of type algebraic, but received Matrix(2, 2, {(1, 1) = -0.3504976272e-3, (1, 2) = -.16509955895845776, (2, 1) = -.30975332953088164, (2, 2) = -0.3504976272e-3}, datatype = float[8]

As far as I can tell (keep in mind that this is my very first Maple project) that it doesn't like lambda as a matrix? But shouldn't it just evaluate to the element? and why is (2,2) and (1,1) giving values, because it should intialize to zero, so exp(0) = 1 in these cases??

I tried to simplify further by just trying


but then it just gives me 1, and when I look into Lambda all the elements are now 1 when only the diagnol elements should be 1 (the rest some fractional amount)??

I am at a complete loss. I thought about doing something like For i = 1 to n etc. but then it just looks like coding, which defeats the purpose of trying to make a calculation sheet documenting the procedure...

Any help and/or insights into what I am doing wrong here would be most welcomed :)

P.S. I've just noticed that there is an upload option :/



This maybe a really simple question, I remember this is doable but couldnt find where the answer is.

Say I write a function to sum up all values in the list,


return printf("The sum is %3.3f. ", sum(data[i],i=1..numelems(data)));

end proc;


and I use it like,




How would I print out a more informative string, like this:

"The sum of listA is %3.3f. "

"The sum of listB is %3.3f. "


Use "data", the input, as a string argument.





Hi Maple friends.

If I have a table of values, how can Maple provide the function?

For example:



How can Maple find out the y function with respect to x? 

Thanks in advance.



I'm trying to make a piecewise function that will have period 12. That is, it repeats every 12 units across the x-axis.


I managed to do one cycle successfully with

plot(piecewise(0<=t and t<2, 4,2<=t and t<12,0), t=0..13);

But I'm not sure how to do it periodically. I thought about using modular arithmetic in the conditions and setting up something like

H(t)=piecewise(0<=modp1(f(t),12) and modp1(f(t),12)<2, 4,2<=modp1(f(t),12) and modp1(f(t),12)<12,0);

but this clearly doesn't work.


Some direction or advice would be appreciated. Thanks!


Hi every Body?

I will define the function f(t) in maple,how?

f(t)=1-t for 0<t<10 and t for t>10


I will a write program in maple for plot the function f(x),while asked value n from user at first,then plot function f(x) for each value of n and finally all plots show in one figure only for different value of n,how to do it?



how i can plot the function in terms of different values of n in a figure:







how i can plot the function f(x) in term of 1/x in maple?for example i have the function f(x)=x^2 and x=0..1,now i plot f(x) in term of 1/x.

Hi all

Assume that we have construct new orthogonal Hybrid function of block pulse and bernstein poly nomials as follow:

and assume that we want to approximate a function as follows:


how can we do this with maple????Indeed we want to optimize using this hybrid functions

note that the degree of bernstein polynomials is fix or should be fixed...and


Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

I have a rank 1 array M of 1000 values.

I want to apply a function f on each value of M and its location giving,

[f(1,M[1]), f(2,M[2]), ... , f(1000,M[1000])]

is it possible to get this using map or map2 or map[n] or maptype (without using seq since its slowing down computation).

inotherwords can i access the member location inside a map evaluation?

Hi All

Assume that we have:

and the hybrid function with block pulses with the following form:

if we want to introduce this form to maple so that we can do:

then how can we do this????

especially if we want to approximate t or t^2 or sin(3*t) by mentioned form, how maple can help us?


thanks a lot for coming answers 

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

We know that the set f:={(1,2),(2,a),(3,b)} can introduce a function from {1,2,3} to {2,a,b}. I want Maple to know f as a function. Is this job possible at Maple? I thought to find the Cartesian product of above latter sets and then try to select "f" as one of its subset but this did not help me to force Maple to take "f" as a function. Indeed, I want to work with this kind of function (like plotting and doing f+g, f-g, fog for two functions for example).

Thanks for your time and help.


4 5 6 7 8 9 10 Last Page 6 of 26