# Items tagged with expressionexpression Tagged Items Feed

### Saving the multiple output of an expression withou...

June 23 2016
2 9

Hi, I am new to maple, but I think that my question should be simple.

I have a matrix where each element is an expression. I want to compute the matrix for different constant and to save it without crushing the previous matrix.

If the file that I joined, I have a first part where the constant are defined. In the second part the expression of the matrix is defined. Finally, I compute each matrix with different constant. Each results is called C_p0, C_s0, C_g0. When I called them back, only the last matrix computed remains.

I would like to be able to save each matrix to performed operation on them later.

Thank you.

Forum_Question1.mw

Homogénéisation

 Paramètre des matériaux

Tenseurs Élémentaires

Tenseur de rigidité

Matrice de rigidité

 (1.2.1.1.1)

 (1.2.1.1.2)

 (1.2.1.1.3)

 (1)

### C expression generated on the RHS?...

June 10 2016
1 8

Dear Forum,

I am a new Maple user, and its symbolic prowess is really amazing. So we are trying to interface it with a C library. I want to generate some C code through Maple, and am trying the CodeGeneration package.

But the default conversion of C(a, b) is b = C language equivalent of expression a.

Now this should be fine for most purposes, but the C library that we are working with, "ACADOToolkit" in this case, requires the equations to be formatted in a certain way. So, I need the following equation in C:

f << dot(v) == (u-0.2*v*v)/m

Now the LHS part of == is to be hard-coded, but we want to generate the equation on the right using maple. Even if I define an equation as

eq1:=  and then use C(rhs(eq1)), I get the result in the form of cg = u - 0.2 ...., whereas I want this to be assigned to something else, in this case - "f << dot(v)= ".

How can I achieve this ?

Thanks

Chintan Pathak

Research Scholar,

University of Washington

### How to simplify this expression?...

June 09 2016
0 6

How can I simplify $\sqrt{1−r^2\exp(2i\theta)}$ in Maple. I could do it by hand but I need this type of simplification later for far more complicated expressions.  I allready tried to enter this as a complex number using II, but simplify(...,'symbolic') didn't simplify this expression. Any suggestion?

### Problem with long integrands...

June 09 2016
1 2

While performing integration of some expessions I bumped into a strange problem. My expession consists of quite a lot of terms, but here I present the susbset of only 2. If I integrate it as a whole maple does not want to solve it, and leaves it as there was no closed expression to this integral. But if I split this sum and integrate the parts, it all works fine. What is happening here? What do I miss? I used simplify and allvalues but didn't change a thing...

Is there a way to split my terms into list, integrate one by one and they recreate the solution by summing the parts? Its a bit of a workaround, but surely better that doing it manually (I have around 50 terms). I use Maple 2015

Thanks,

Jeremi

### List of forms of expression under combination of i...

April 28 2016
0 6

Suppose I have a triplet and an expression given as below:

 >

How I can list all possible forms of above expression for triplet etc

Regards

### Problem with applyrule...

April 12 2016
0 3

Hi,

can you please help me with the usage of applyrule? I have the following problem that I cannot isolate. I have a rule that I want to apply, but instead of applying the rule to the expression, the rule seems to be applied to itself. In an isolated worksheet everything is fine:

 > restart;
 > rule:=abs(''a''::algebraic)^2=''a''^2;
 (1)
 >
 (2)
 > applyrule(rule,myexp);
 (3)
 > rule
 (4)
 >

What happens when I try to use this rule in my script is this:

 > restart;
 > rule:=abs(''a''::algebraic)^2=''a''^2;
 (1)
 > applyrule(rule,abs(x)^2)
 (2)
 > rule
 (3)
 >
 >

I want to clarify, that the script that is read before applying those rules does not apply a similar rule. Also the variables rule and x were free. Can you please help me to locate the problem?

Thanks!

Honigmelone

April 01 2016
1 1

Hi all,

I am trying to do some calculation using Maple. I have different expressions containing some power of y. I would like that Maple automatically substitutes y^4 = f(y), in each one of these. So for example, if my expression contains y^5, I want it substituted by y * f(y), and so on. How can I do?

March 25 2016
1 5

Dear All

I want to use subs command to replace products in expression with entries from matrix. When I use "subs" command it returns same result as original without any substitution. But when I use "algsubs", it works fine, but is complicated to apply if there are large number of substitutions.

 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)

Why this command subs in not replacing  products   from matrix (1)?????

 >
 (5)

It worked !!!! But If I try "algsubs" like :

 >

See it is giving error !!! but still I can use "algsubs" as follow:

 >
 (6)

But this procedure is complex, I want to use "subs" only. I know it complexity of terms in (3) might me creating problem.

 >
 (7)
 >

Regards

### How to form list of op results?...

March 16 2016
0 2

2*t*exp(t) + 2*t

would like to apply op recurively

and output list

[2,t,exp(t),2,t]

### How can I get result of real part?...

March 02 2016
0 8

Hi all!

as shown below, how can get a result without 'R':

p_com(z,t):=Re(exp(I*omega*t-I*k*(lambda[r]+I*lambda[i])*z)) assuming omega::real,t::real,k::real,lambda[r]::real,lambda[i]::real,z::real

Thanks very much!

### Problem with Numeric Differentiation...

March 02 2016
1 6

Hi Guys,

I'm trying to find stationary points of a numeric function. Any help would be appreciated.

Assume I have a numeric function g(x). I'm attempting the following:

deriv:=(x)->fdiff(g(t),t=x); (I can't use the D operator as it doesn't like g(x))

Now deriv(x) <- Can be computed and computes the value quickly and easily. However plot and other functions require algebraic functions. I can plot this (with difficulty) via the following

plot(deriv,-10..10) <- This avoids converting to algebraic function and runs as a procedure.

I can't use convert(deriv,algebraic) as it fails.

I want to use the Student[NumericalAnalysis]Roots command, but it requires an algebraic function and I can't use the procedure trick which I did in the plot command.

Does anyone know a better way of doing this? or is there a way I can write the numerical differivative as an algebraic function. (I've tried fsolve <- But this guy doesn't give me the correct answers generally).

Thanks guys.

### Collect wrt to fraction...

February 29 2016
1 3

Dear All

How can we collect coefficient wrt certain differential ration in an expression?

See for detail:

 >
 >
 (1)
 >
 (2)
 >
 (3)

How ca extract coefficients of fraction  in (3) ????

Regards

### Expression vs function...

February 25 2016
0 11

I am wondering why Maple does this.

> f:=x^2
> f(3)
output: x(3)^2

I understand the difference between an expression and a function. If f is an expression, shouldn't it ouput  x^2(3). Why is the output x(3)^2?

When I enter f*3 or f*(3) then I get the correct expression.

Here is a screenshot. http://prntscr.com/a7u9hm

Here is image inserted with a slightly different function

Also while I am here, what exactly does g(x):= x^2 do? when i enter g(3) I get g(3) back.

g(x) is neither a function nor an expression.

screenshot http://prntscr.com/a7ua75

### Simplification of expression with Maple...

February 25 2016
3 48

I am haunted by an equation which I could simplify it with hand and it equals to −i (complexe number). But, I don't know how to use maplesoft to simplify it. The equation takes the form of:

-Omega*a*sqrt(2)*sqrt(-Omega^2*a^2-2*k*m+sqrt(Omega^2*a^2*(Omega^2*a^2+4*k*m)))/(-Omega^2*a^2+sqrt(Omega^2*a^2*(Omega^2*a^2+4*k*m)))I could simplify this equation with hand calculation and it equals to -i (the complexe number). I'am sorry for not clarifying that the a, k, Ω and m are positive variables.Thank you in advance for taking a look.

### Collecting coefficients in differential expression...

February 17 2016
0 0

Dear all

I have problem related to collection of coefficient of differtials in differential expression containing multiple dependent variables and we want to collect coefficient wrt to selected dependent variables. Please see attached Maple file for details.

 >
 >
 (1)
 >
 (2)

Suppose we differential expression like:

 >
 (3)

We can collect coefficients of differential like in following manner:

 The Procedure

Now how can we collect coefficents with respect to so that differential expression (3) appear as

 >