Items tagged with coeff coeff Tagged Items Feed

Hello.

I am trying to extract all the coefficients of a linear equation by calling coeffs function.

eq := 1.2*a[2]+1.3*a[3]+1.1*a[1]+1.0

1.2*a[2]+1.3*a[3]+1.1*a[1]+1.0

(1)

 

vars := [seq(a[i], i = 1 .. 3)]

[a[1], a[2], a[3]]

(2)

coeffs(eq, vars)

1.0, 1.2, 1.3, 1.1

(3)

``


I expected I receive the coefficients in the same order as in vars variable, but I was wrong. How to extract coefficients in the order I need?

Download test.mw

 

I want to extract all the coefficients of a polynomial. For example, let p:=x^5-8x^3+2, and the function coeffs(p) returns 1, -8, 2. In fact, I want to obtain 1, 0, -8, 0, 0, 2. Thanks to everyone.

Dear all, 

I'm trying to extract the coefficients from the equation below, the fat expressions in the equation. I don't have any trouble seperating the sine or cosine functions. But the constants are a problem. Since t is the only variable in the function i tried, coeff(R, t, 0). This does not work apparantly. Any suggestions? 

 

R:=(1/12)*C2^3*cos(2*t) - (1/48)*C2^3*cos(4*t) - C2^3*sin(t) + C2^3*sin(3*t)-C2^2*C4*cos(t) + C2^2*C4*cos(3*t) - (1/8)*C2^2*C4*sin(2*t) + (1/16)*C2^2*C4*sin(4*t) + (1/16)*C2*C4^2*cos(4*t) - C2*C4^2*sin(t) - C2*C4^2*sin(3*t) - C4^3*cos(t) - C4^3*cos(3*t) - (1/24)*C4^3*sin(2*t) - (1/48)*C4^3*sin(4*t) - (1/16)*C2^3 - (1/16)*C2*C4^2 - (1/2)*C2*cos(2*t) + C2*sin(t) + C4*cos(t) + (1/2)*C4*sin(2*t) + (1/2)*C2

Hi,

I have these lines in my code, the function alpha:=(m,n,1)->...... is defined in the last line of the code below, but when I want to calculate alpah(1,1,1), there is no numeric value. Why????  Many thinks

 

 restart:
with(LinearAlgebra):
with(plots):
with(PDEtools):
with(IntegrationTools):
interface(rtablesize=20):
d:=1: N:=2: a:=1: h:=a/N:
Kernel(x,y):=ln(abs(x-y)):

 eq2:=int(Kernel(x,y)*phi(y),y=-a..a)=sum(int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h),n=-N..N-d):

Approximate the integral
eq3:=phi->int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h)=add(beta[i,n]*phi((n+i-1)*h),i=1..d+1):
eq4:=int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h)=add(alpha[m,n,i]*phi((n+i-1)*h),i=1..d+1):

Compute the coefficients  beta[i]

Vct_basis:=[seq(x^i,i=0..d+1)]:
fct:=[seq(unapply(Vct_basis[i],x),i=1..d+2)]:


sys:=[seq(eq3(fct[i]),i=1..d+1)]:
x:=m*h:
w := [seq(beta[i,n],i=1..d+1)]:
M,b := GenerateMatrix(sys,w):

M1:=-M: V:=-b:

Vect_beta:=(M1)^(-1).V:# Vect_beta is a vector.

beta[1]:=Vect_beta[1]:  
alpha1:=(n,m)->beta[1];
(n, m) -> beta[1]
alpaha(1,1);
                                alpaha(1, 1)  ??????????????????? No numeric result


 

Dear all

 

Please I need your help to simplify by the coefficient a in this Matrix

I have The matrix A defined by  A:=Matrix(2,2, [[a,a],[3*a,4*a]]);

I want with maple transform A to  A:=a*Matrix(2,2, [[1,1],[3,4]]);

Thanks for your Help.

 

In the following script, I am trying to understand why evala returns an error. It returns

                Error, (in evala/Reduce/nf/indep) invalid arguments to coeffs

in a couple of places. I tried, and I can get around the errors by doing it a complex way, but it seems like I'm just not using evala correctly. Perhaps someone can comment? I'd very much appreciate it.

 

Hey guys..

I need some help on determining the correlation coefficient between my data points for an Influenza epidemic and the SIR model, with my estimated parameters Beta and Alpha. The initial conditions for the equations are defined at the beginning of my worksheet:

SIR_model.mw

Hope someone can help me ;)

 

 

 

I have a multivariate polynomial equation, in that somehow I know the coeffcients, using this information, I want to extract the variables. This will be the opposite of coeffs function.

for e.g. I have 3*x3 + 5*x4

Given 3 and 5, I want to extract x3 and x4.

 

Thanks in advance.

 

Satya

 

Hello,

i want to solve the following for q[b], theta is a symbolic coefficient. When I use the solve command it produces a RootOf that i cannot handle by using either allvalues or evalf. I can't use fsolve since there is theta 

I have Zipped 2 equations together to equate their equivalent Coefficients.  I now need to assign solve the list fot each value of N (1...9) How do I get Maple to do this reliably for the list as N 1..9 does not necessarily occour in sequence.

Hi, I am trying to compute the coefficient of a polynomial as follows:

a:=(1/11520)*(4518-4320*r^(2*n)-5760*_C1*n^4*r^2-97920*_C1*n^2*r^2-97920*_C1*n*r^2-40320*_C1*n^3*r^2+2020*r^6*n^3+1500*r^6*n^2-1440*r^(2*n+6)+60*r^8-2880*r^(2+2*n)-720*r^4-100*n^5-339*n^2+3018*r^2+4560*r^(2+2*n)*n-240*r^(2*n+4)*n^2-480*r^(2+2*n)*n^4+50*r^8*n-130*r^8*n^4-270*r^8*n^3-170*r^8*n^2-20*r^8*n^5+480*r^(2*n+6)*n+480*r^(2*n+6)*n^3-480*r^(2*n+6)*n^2-1680*r^(2+2*n)*n^3+160*n^5*r^6-102*n*r+320*r^2*n^5+1783*r^2*n^4...

I have a rather large multivatiate polynomial "Dtest"  I need to divie it by a cubic poly "DGm" using rem and quo. Both are determinants multiplied out,  both given below. Have spent the past 2 nights trying to sort, collect, expand, equate coefficients plex groebner etc. Am trying to collect up all the powers of c3 but cant anything to work. even expand doesn't fully expand "Dtest". If I set c1 and c2 to 1 things are...

I have the following lines of code:

 

W:=sum((k^(2*i))*sum((e^(j))*w[i,j](r,t),j=0..2),i=0..2);

P:=sum((k^(2*i+1))*sum((e^(j))*w[i,j](r,t),j=0..2),i=0..2);

for c from 0 to 2 do

  for d from 0 to 2 do

    rw[c,d]:=coeff(coeff((k/(2*r))*(diff(W,r)*diff(P,t)-diff(W,t)*diff(P,r)),k,2*c),e,d)

  end do

end do;

 

I mean to compute the coefficients in front of powers of e inside...

Page 1 of 1