## i want to know how to save a a constant of a fun...

i want to know how  to save a  a constant of a funcition as a variable.

for example:
eq:=x=1-3*t

i want to save 3 as variable
c:=3

## Splitting an equation by its addition terms....

Hi, I wondered if anyone knows a way to separate out addition (or subtraction) terms in an equation.

For example given eqn1:

eqn1:= (1/2)*p+1+(-4*p^2-p-1)/(3*p^3+7*p^2+2*p+2)

I would like to get the first rational term before the first plus (or minus) sign. In this case it would be (p/2).

This is a trivial example shown above but the real value in this is that I want to customize my own factorizations using the pratial fraction function of Maple. In this case I would not know eqn1 before hand but it would be the solution to some previous factorization and I need just the first term (before the first plus sign).

If anyone knows any tips or tricks that will set me on the right path to doing this it is most appreciated.

## Assume products of variables are zero in large set...

I am interested in the behaviour of a system of equations close to the origin- these equations are quite long, and there are a lot of them so i would like to have commands that i can use to assume products of variables are zero.

here are the first two polynomials:

alpha*k[a1]*B[1]^2+(-alpha*k[a1]-alpha*k[a2])*B[2]*B[1]+2*alpha*k[a1]*B[1]*B[11]+alpha*k[a1]*B[12]*B[1]+2*alpha*k[a1]*B[1]*B[211]+alpha*k[a1]*B[221]*B[1]+2*alpha*k[a1]*B[1]*B[2211]+(-alpha*R[b]*k[a1]-k[d1])*B[1]+2*B[11]*k[d1]+B[12]*k[d2]+k[d1]*B[211]+k[d2]*B[221]

(-alpha*k[a1]-alpha*k[a2])*B[2]*B[1]+alpha*k[a2]*B[2]^2+2*alpha*k[a2]*B[2]*B[22]+alpha*B[2]*B[12]*k[a2]+alpha*k[a2]*B[2]*B[211]+2*alpha*k[a2]*B[2]*B[221]+2*alpha*k[a2]*B[2]*B[2211]+(-alpha*R[b]*k[a2]-k[d2])*B[2]+B[12]*k[d1]+2*B[22]*k[d2]+k[d1]*B[211]+k[d2]*B[221]

the varables are the terms with B and a subsript and everything else is a parameter.

My intuition was to use coeffs but I couldn't get anything helpful

## Coefficients extraction to form Equations...

N := 4;
print(`output redirected...`); # input placeholder
4
y := sum(A[2*n].cos(2.*n.x), n = 0 .. N);

eq1 := diff(y, `\$`(x, 2))+(a+2*q*cos(2*x))*y

eq2 := map(combine, eq1, trig)

for i from 0 to 4 do eq4[i] := coeff(eq2, cos(2*n*x)) end do

From these I want to extract the co-ffficients of cos(0x),cos(2x),cos(4x)..

and form a simultaneous linear equation containg A0,A2,A4

The solution is

aA0+qA2=0

2q*A0+(a-4)*A2+q*A4=0

Can anybody tell me how to do it

## How to extract symbolic coefficient?...

Hi dear Maple masters:

Excuse-me. I have a stupid question to ask: how to extract symbolic coefficient in maple? For example, I would like to get the coefficient before sin(Ωt) and cos(Ωt) in the following equation:

eq := (-Omega^2*a*A[2]-Omega^2*m*B[1]+Omega*A[1]*c[1]+B[1]*k[1])*cos(Omega*t)+(Omega^2*a*B[2]-Omega^2*m*A[1]-Omega*B[1]*c[1]+A[1]*k[1])*sin(Omega*t) = 0;

Thank you in adavance for taking a look, wish you a nice day!

Best regards,

Zihan

## Extracting coefficients from series...

I am trying to extract the coefficients of z from its series expansion. In two cases I succeed in finding the coefficients, but in the last one I fail to get the correct coefficients. Some garbage value is obtained. What is the reason behind this? I have attached my maple program.

test.mw

## Coefficients in differential expression...

Dear Friends

In differential expressions(See Maple file) how to find coefficiets of dependent variable "u(x,t)" and "v(x,t)" and of their differentials ? There is command "dcoeffs(function)", but that work for single dependent variable only but in our case there are two dependent variables in consideration. There are other options like "indets", "specindex" but those do not work.

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

In above differential expressions how to find coefficiets of dependent variable "u(x,t)" and "v(x,t)" and of their differentials ? There is command "dcoeffs(expr,u(x,t))", but that work for single dependent variable only but in our case there are two dependent variables in consideration. There are other options like "indets", "specindex" but those do not work.

 >

## Coefficients of differential polynomial. 2...

Hello everyone!

Suppose, we have a differential polynomial

P := u(x) + (D@@2)(u)(x)

Given this, I am looking for a procedure which gives coefficients depending on the order given as input, for example, lets say, procedure name is fun_coeff which depends on two parameters, original polynomial P and the order n, then

fun_coeff(P, 3) should give [1, 0, 1, 0]

where each entry corresponds to the coeff of

[u(x), (D@@1)(u)(x), (D@@2)(u)(x), (D@@3)(u)(x)]

in the polynomial, similarly

fun_coeff(P,4) should give [1, 0, 1, 0, 0]

corresponding to

[u(x), (D@@1)(u)(x), (D@@2)(u)(x), (D@@3)(u)(x), (D@@4)(u)(x) ]

Thank you all for your time :)

## Error when fitting function to data...

Dear Maple users

Physical experiment: I dropped a ball with low mass from a height of approximately 7 meters and wanted to test if the air resistance was proportional to the square of the velocity. I filmed the fall and used the program Logger Pro to collect data: a number of datapoints (time,height) was collected. I copy/pasted the datapoints into MS Excel, from where I could import data into Maple via Tools > Assistants > Import Data ... Then I wanted to make a fit with the theoretical solution, given by a function having just one parameter: the Drag coefficient. Unfortunately I received an error "complex values encountered" (see below). I can solve the problem manual by making a number of guesses for the drag coefficient, until the theoretical curve approximates the data points well. I wanted to make Maple do the fitting job, though. I will appreciate if someone could give an idea how to fit the data properly.

NB! Mass m and g is defined above in the Maple document. The Statistics and plots package is called too.

## Coefficients of differential polynomial...

Hello everyone,

I am trying to extract the coefficients from a differential poynomial. In general, this poynomial is in two variables, say u and v along with their differentials, i.e D(u) or D@@2(u) or so on.

Coefficients of this polynomials are rational funcitons.

For instance- consider the following example:

a(x)*v*u+v*D(u)-D(v)*u

then output should be [a(x), 1, -1].

## problem in procedure...

hello all!

Pascal := proc (n::posint)

local x, y, i;

for i from 0 to n do print(coeffs(expand((x+y)^i)))

end do end proc;
Pascal(4);

1
1, 1
1, 2, 1
1, 3, 3, 1
1, 4, 6, 4, 1

How to create

1
1  1
1  2  1
1  3  3  1
1  4  6  4  1

## How to find linear combination? ...

assume there is vector a,b,c and d which are real number or floating number

how to express a in linear combination of b ,c and d

in another words, how to find coefficient m1, m2, m3

in a = m1*b + m2*c + m3*d

can LinearSolve do this?

Assume that I have r:= -6x+3y+23x2-4xyz+7z. By using coeffs(r,x,'k') I can find the coefficients of 1, x, and x2

What should I write to get the conditions that make the coefficient of x zero? How can I just pick the coefficient of x, and solve it.

I have several coefficients but the answer of this question will help me.

Thanks.

## Maple does not print in order for some reason......

Problem: I have two polynomials with arbitrary coefficients. I set them both to 0 and I used the 'map' , as well as 'coeffs' command to make the coefficients equal to 0.

Now for some reason, Maple does not print in order for one of the polynomials and it does for the other.

Note that 'order' refers to the coefficients attached to the powers of the variable.

Quick example: (this one actually works on Maple, but just not the one I have)

e1:= ax + (b + c)x^2 = 0

e2:= (c + d)x + (a + c)x^3 = 0

After applying map and coeff, one expects it to output

a = 0, (c + d) = 0, (b + c)=0, (a + c) = 0