Items tagged with coeff coeff Tagged Items Feed

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

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

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

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.

 


with(PDEtools):

DepVars; -1; [u(x, t), v(x, t), r[1](t), r[2](t), s[1](t), s[2](t), p[1](t), p[2](t), alpha[1](x, t), beta[1](x, t), beta[2](x, t), delta[1](x, t), delta[2](x, t)]

[u(x, t), v(x, t), r[1](t), r[2](t), s[1](t), s[2](t), p[1](t), p[2](t), alpha[1](x, t), beta[1](x, t), beta[2](x, t), delta[1](x, t), delta[2](x, t)]

(1)

alias(u = u(x, t), v = v(x, t), r[1] = r[1](t), r[2] = r[2](t), s[1] = s[1](t), s[2] = s[2](t), p[1] = p[1](t), p[2] = p[2](t), alpha[1] = alpha[1](x, t), beta[1] = beta[1](x, t), beta[2] = beta[2](x, t), delta[1] = delta[1](x, t), delta[2] = delta[2](x, t))

u, v, r[1], r[2], s[1], s[2], p[1], p[2], alpha[1], beta[1], beta[2], delta[1], delta[2]

(2)

(diff(r[1], t))*(-s[1]*u*(diff(u, x))-p[1]*((diff(u, x))*v+u*(diff(v, x)))-alpha[1]*(diff(u, x))-beta[1]*u-delta[1])/r[1]+r[1]*(diff(alpha[1]*(diff(u, x))+beta[1]*u+delta[1], x, x))+(diff(s[1], t))*u*(diff(u, x))+s[1]*(alpha[1]*(diff(u, x))+beta[1]*u+delta[1])*(diff(u, x))+s[1]*u*(diff(alpha[1]*(diff(u, x))+beta[1]*u+delta[1], x))+(diff(p[1], t))*((diff(u, x))*v+u*(diff(v, x)))+p[1]*((diff(alpha[1]*(diff(u, x))+beta[1]*u+delta[1], x))*v+(diff(u, x))*(alpha[1]*(diff(v, x))+beta[2]*v+delta[2])+(alpha[1]*(diff(u, x))+beta[1]*u+delta[1])*(diff(v, x))+u*(diff(alpha[1]*(diff(v, x))+beta[2]*v+delta[2], x)))+(diff(alpha[1], t))*(diff(u, x))+alpha[1]*(diff(alpha[1]*(diff(u, x))+beta[1]*u+delta[1], x))+(diff(beta[1], t))*u+beta[1]*(alpha[1]*(diff(u, x))+beta[1]*u+delta[1])+diff(delta[1], t)

(diff(r[1], t))*(-s[1]*u*(diff(u, x))-p[1]*((diff(u, x))*v+u*(diff(v, x)))-alpha[1]*(diff(u, x))-beta[1]*u-delta[1])/r[1]+r[1]*((diff(diff(alpha[1], x), x))*(diff(u, x))+2*(diff(alpha[1], x))*(diff(diff(u, x), x))+alpha[1]*(diff(diff(diff(u, x), x), x))+(diff(diff(beta[1], x), x))*u+2*(diff(beta[1], x))*(diff(u, x))+beta[1]*(diff(diff(u, x), x))+diff(diff(delta[1], x), x))+(diff(s[1], t))*u*(diff(u, x))+s[1]*(alpha[1]*(diff(u, x))+beta[1]*u+delta[1])*(diff(u, x))+s[1]*u*((diff(alpha[1], x))*(diff(u, x))+alpha[1]*(diff(diff(u, x), x))+(diff(beta[1], x))*u+beta[1]*(diff(u, x))+diff(delta[1], x))+(diff(p[1], t))*((diff(u, x))*v+u*(diff(v, x)))+p[1]*(((diff(alpha[1], x))*(diff(u, x))+alpha[1]*(diff(diff(u, x), x))+(diff(beta[1], x))*u+beta[1]*(diff(u, x))+diff(delta[1], x))*v+(diff(u, x))*(alpha[1]*(diff(v, x))+beta[2]*v+delta[2])+(alpha[1]*(diff(u, x))+beta[1]*u+delta[1])*(diff(v, x))+u*((diff(alpha[1], x))*(diff(v, x))+alpha[1]*(diff(diff(v, x), x))+(diff(beta[2], x))*v+beta[2]*(diff(v, x))+diff(delta[2], x)))+(diff(alpha[1], t))*(diff(u, x))+alpha[1]*((diff(alpha[1], x))*(diff(u, x))+alpha[1]*(diff(diff(u, x), x))+(diff(beta[1], x))*u+beta[1]*(diff(u, x))+diff(delta[1], x))+(diff(beta[1], t))*u+beta[1]*(alpha[1]*(diff(u, x))+beta[1]*u+delta[1])+diff(delta[1], t)

(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.

``


Download Coefficients_in_differential_expression.mw

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 :)

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.

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].

 

Thanks for your help.

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

 

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. 

HPM_4.mwhi, I am using homotopy perturbation technique but there is arising an error in comaring coeffecient of p^0, p^1,.... plz help me

 

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

 

instead I got

 

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

 

Here is the problematic file

OutOfOrder.mw

Why the command

 

coeff(sum(x^i,i=0..999)^500,x,2) prints

 

Error, unable to compute coeff??

 

I believe, that memory/cpu issues are not a relevant answer here.

 

Already

coeff(sum(x^i,i=0..998)^500,x,2) gives the correct result.

Even

coeff(sum(x^i,i=0..998)^500,x,200) is ok.

How do I compute coeffs of longer sums?Or why this limitation is imposed by Maple Server?

Hi,

 

  Excuse me, I tried to substract in a series expansion. It works for Taylor-type expansion, but not Laurent-type ones

*********

ffff:=1/(t-3);
ggg:=taylor(ffff,t=infinity,3);
coeff(ggg,t,-1);


ffff:=exp(t);
ggg:=taylor(ffff,t=0,3);
coeff(ggg,t,1);

*********

Maple gives me


Error, unable to compute coeff


1

 

. My question is, why "coeff" does not work in the first case? how to make it work? Though I can copy the expansion part, assign it to another variable, and "coeff" will work

 

1 2 3 Page 1 of 3