Items tagged with define define Tagged Items Feed

This has been buggin me all day, but if i define a variable with an expresion say "a:=3 x+5" and i then want to assign this expression to a function like so "f:=x->a". if i then call f(7), maple return with "3 x+5" so just returning the value of a without substituting x with 7.

Is there any way in which i can define a function this way?

I want to define the budget set of a consumer, which consists of an horizontal, slant and vertical line segments. How can I define and plot the budget set?

Hello Maplers, i have encountered a little annoyance with Maple, that i would like to ask, whether it can be solved. 

 

It's when i try to define a function, like f(x)=2x and try to define it with a command f(x):=2x, a pop-up box comes up, asking me whether i'd like to use a 'function definition', or 'remember table assignment', and i would like to make Maple remember my choice that i want a function. 

 

I know i can write it like f:=x->2x, but i hate to look at that, to be frankly..

 

So, is there any way to solve this?

 

How can I create a new object from a stanrd, defined in a given metric? For example I want to define an object by convolution of two indices of the Christoffel symbols? I cannot even to see components of such object.

Many thans for an explanation

 

Leonid

Can we define/set a range in Maple. e.g 


I have the following equation:

y = 1.048 + 1.02*x + 6.118*(z-4.041*x^2) + 16.22*(z^2) +6.241* (x*z)

The value of z is within 0.001 - 0.543, y is from 1 - 12 and x is from 0.001 - 0.7

How should I define it in Maple, so while solving equations it read the values within the given range? 


I want to define a band matrix using n vectors. Detial given maple sheet. please help me

Help.mw

I want to define a matrix of M by M which have some condition. detail given in maple file. please help me.

Help_Maple-1.mw

Hello,
my question may be simple but I don't find the answer in any help guide.
when I define a function I cannot use a linearalgebra expression such as Trace.
Here is an example of what I would like to do:




If anyone can help me...
Thank you

I need to create a function from one list to another, but I don't want to define an operation.  I only want to assign a 1-1 mapping from a list of 64 elements to another list of 64 elements, i.e. the 1st element in list a is assigned to the 1st element in list b, etc.  I see plenty of examples of how to do this with an operation, but I don't want the mapping to perform any operation, just the mapping.  How is this done?

Find a loop do define these matrices, even for large values of n. Record the Matrix Mn 

 

all i,j=1,2,13,..,n for example 

N := `<|>`(`<,>`(1, 2), `<,>`(2, 2))

P := `<|>`(`<,>`(1, 2, 3), `<,>`(2, 2, 3), `<,>`(3, 3, 3))

Q := `<|>`(`<,>`(1, 2, 3, 4), `<,>`(2, 2, 3, 4), `<,>`(3, 3, 3, 4), `<,>`(4, 4, 4, 4))

 

Please help!!!

I am trying to figure out how to enter tensors using the new Physics package in 17.02. For my first, presumably simple example, I am trying to reproduce the Lorentz transformation in Special Relativity:

 

Xμ' = Λνμ Xν

where

Λνμ = [{γ, -γβ, 0, 0}, {-γβ, γ, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}]

Xν = [x0, x1, x2, x3]T

My Λ tensor Defines just fine; I do

Lambda[nu, `~mu`] = (Matrix(4, 4, {(1, 1) = gamma, (1, 2) = -gamma*beta, (1, 3) = 0, (1, 4) = 0, (2, 1) = -gamma*beta, (2, 2) = gamma, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1}))

(which, upon <Enter> is labeled (1)), and then

Define((1))

and this suceeds. However, when I do the X vector:

X[`~nu`] = (Vector(4, {(1) = x0, (2) = x1, (3) = x2, (4) = x3}))

which is labeled (2), then the Define((2)) function returns the following error:

Error, (in Physics:-Define) expected right-hand-side of tensor definition as an algebraic tensorial expression, or a Matrix or an Array, representing the evaluation rule for the tensor X[`~nu`]; received: Vector(4, {(1) = x0, (2) = x1, (3) = x2, (4) = x3})

So my question is, what is the correct syntax for Defining or declaring a vector to be a tensor?

(Also, incidentally, why is the covariant (superscript) index ~nu being displayed as a subscript when Maple echoes my entry?)

Thank you,

Kevin

When I solve a systems of equations, fsolve gives the solution

{ x = 5, y= 6, z = 1}.

I now want want to define the variables x, y and z as respectively 5, 6 and 1 - but without copying the solution. Because this is a solution that I get in a loop, so it changes in every step. Maybe there is a easy way to put it in a vector?

My mathematics computation relies on a loop.

That loop is heavy and takes very long time to finish.

I try to split some undetermined functions outside the loop so that the work inside the loop will be easier.

I don't know how to use proc or module. Is there any tutorial that can help me as a beginner on this part?

Basically i need maple algorithm that enables user to call a user-defined function from another function.

And also how can...

How do you define v=v(r) in maple? As to say 'v is a function of r'.

Thanks

I'm trying to use define but get unexpected behavior. Say I want to declare that the map phi is additive. I would try this

define('phi',phi(x::`+`)=map(phi,x));

But if I do phi(x+y) now, I get a warning about an infinite recursion. I get an indication of what the problem is if I define instead

define('phi',phi(x::`+`)=op(x));

Now phi(x+y) produces "x+y" rather than "x,y", so somehow the sum is considered atomic. Can somebody explain this to me?

1 2 3 Page 1 of 3