Items tagged with define define Tagged Items Feed

How to define for a library

April 07 2012 by marram 25 Maple

old version define use
'homalg/default':=RPI;

in maple 15
libname := "D:/homoalg/10_homalg.lib",libname:
with(homalg):

> define(homalg, RPI, 'default');
Error, (in define) homalg is assigned
> hom2 := Hom(L, K, var);
Error, (in homalg/tablename) Since homalg/default is not defined, the last argument must be a table containing the (minimum) homalg conversions or an unassigned symbol pointing to such a table!
> define(homalg, 'RPI', 'default');

I want to solve numerically the nonlinear problem 

a*(diff(y(x), x, x))+2*(diff(y(x), x))+exp(y(x)) = 0, y(0) = 0, y(1) = 0

by defining my own method defined as 

yn+1=yn+2*h*(-2*yn+2*ln(2/(1+x))-(1/2)*a)^2/(a*(-4*yn+4*ln(2/(1+x))-a-h*(4*yn-4*ln(2/(1+x))+a+x+1)/a))

where h is the step-size. Please help me by letting me know how can I do this using Maple 11.

 

for example, how to define f(x,y)=sin(x+y) inside a triangle but f(x,y)=0 elsewhere? 

HI,

 

at first I have to admit, that I'm totaly new to maple and have only few experience with the programm.

 

That's the problem. I've got an old maple-code which I want to rewrite in the 2d-Math-syntax. In the code there are a lot of variables of the type "numerical integer" with a form like

"rho_a"

"N_A"

....

--> with index in the name

It's a code for a physical-/chemical- process so the...

f(x):=((e^-ax^2)-bxln(1+x^2))/(2+x^2+csin(Pi*x))

i have defined a,b and c. (all randoms numbers between 0 and 1 )

But when i try to plot it

plot((f(x)), x=-4..4) i get ( warning unabe to evaluate function to numeric values ion the region)

also i can plot the graph even without a range included ???

What am i doing wrong, have i defined f(x) right. thanks in advance

also i can plot the graph even without a range included ???

Defining Functions

October 31 2011 by Garlando 5 Maple

I would like to define a function f(a,b,c,....) sub that x * f(a,b,c,...) would return f(x*a,x*b,x*c,...). Is this something that is simple to do in the function definition or do I need to create a rule to apply?

Solving set of equations

June 27 2011 by AliKhan 5 Maple 14

Hi All,

I am trying to solve set of equations after applying boundary conditions.  There are 4 coefficients which I have to find by solving following 4 equations;

I tried to solve using the command solve({A, B,C,D},[E,F,G,H]), but it just returns [],  does anyone know which command to use for backward substitution of coefficients.  Also if I try to solve it separately, it says "recursive error"

Your help will be appreciated

Thanks

Hello,

I am having trouble in defining multivariable functions. For instance, when I define the follow code:

assume(n>0)

 f:=(x_1,x_2,...,x_n) -> sum(x[i],i=1..n)

I get the error: Error, invalid operator parameter name.

How can I define this type of function when the number of variables is conditional on "n" ?

Hi! Normally recursively defined functions work well, but if I use a sum inside, this happens:

> y:=n->sum(y(k),k=0..n-1);

                                   n - 1
                    ...

I have three different matrices, say A(3x6),B(3x6) and C(3x12) with the size of each matrix mentioned within parenthesis. I want to define a fourth matrix D (6x12) so that D=[A,B;C] (in Matlab notation). Can anyone please tell me how to define this D in Maple? Maple help seems not that helpful at least for beginners like me. Thank you in advance.

Hi!

> define( f , diff( f(x,y) , x ) = f1x(x,y) , diff( f(x,y) , y ) = f1y(x,y) );

produces

> diff( f(x,y) , x );
0

> diff( f(x,y) , y );
0

> diff( f(x,x) , x );
f1y(x,x)

So how can I do it correctly?

Hi there,

 

I have defined an own type MyType wich is internally just a list ['MyType', A, B] with let's say two lists A,B and the symbol 'MyType' as first element (to identify the type).

Now, if I define

X := MyType('MyType', A, B);

is there a possibility to extract A out of X by something like

X[2]

or even better X[1] (thus skipping the first one)? The only thing I know is op(2, X).

Everyone knows what a French curve is. Heck, some of us even have a set kicking around. But I have run into a brick wall in trying to find out how a french curve is actually made, or defined. Over several sessions, I can find nothing on the net that even hints at the answer.

French curves have been in use for ages, and they must have an origin. Either they are generated using some kind of function, or they were perhaps...

there are several method to provide solve recurrence problems  in Maple,such as define ,rsolve,etc.here ,i meet a problem.

i want to compute the function Gamma(n), if n is a posint ,only given recurrence relation f(z)=(z-1)f(z-1),initial condition,f(0)=1,then i can get the true result with rsolve,of couse,i had made  an ansatz that z is n::posint.yet ,z is not posint? To suppose z  equal to 5/2, (2*n+1)/2 more generally,how can get the answer((2n-1)!!*Pi/2^n).

Quick question, why doesn't the following return a~?

> define(g, g(a::realcons) = a);
> assume(a::realcons);
> g(a);
                              g(a~)

How do I get it to do so?

Thanks!

1 2 Page 1 of 2