Items tagged with help help Tagged Items Feed

Dear Maple Experts,

i am new to maple and I am trying to write a maple algorithm in order to calculate the GCD of two functions. 

I have defined the two functions and written the algorithm, but I get an error "Unable to Parse".

Here is my code:

restart; with(Algebraic); with(LinearAlgebra[Generic]); with(RegularChains); with(FastArithmeticTools); with(ChainTools); interface(rtablesize = 15);

f := (y^2-1)*((y+1)*x^4+(y^2-1)*x^3+(y^3-1)*x^2+(y^4-1)*x+y^5-1);

g := (y-1)*x^5+(y^2-1)*x^4+(y^3-1)*x^3+(y^4-1)*x^2+(y^5-1)*x+y^6-1;

SubRes:=proc(f,g,var): local  i,a, delta, beta, psi: if degree(f,var)<degree(g,var) then a[0]:=Algebraic:-PrimitivePart(g,var): a[1]:=Algebraic:-PrimitivePart(f,var): else a[0]=Algebraic:-PrimitivePart(f,var): a[1]:=Algebraic:-PrimitivePart(g,var): fi: delta[0]:=degree(a[0],var)-degree(a[1],var): beta[2]:=(-1)^((delta[0]+1)): psi[2]:=-1: i:=1: while a[i]<>0 do a[i+1]:=(prem(a[i-1], a[i], var))/(beta[i+1]): delta[i]:=degree(a[i],var)-degree(a[i+1], var): i:=i+1: psi[i+1]:=((-lcoeff(a[i-1],var))^((delta[i-2])))*((psi[i])^((1-delta[i-2]))): beta[i+1]:=-lcoeff(a[i-1],var)*(psi[i+1])^((delta[i-1])): od: print("Last Non-Zero Subresultant: ", sort(simplify(a[i-1])),y): return (Algebraic:-PrimitivePart(a[i-1],var)): end proc

and I get this error:

Error, unable to parse

Would you kindly help me to fix this issue?

Kind Regards,

Ash

 

I'm brand new to Maple and was assigned a problem to modify a code provided by my professor to incorporate variable window size. However, I don't know where to begin or what I'm doing. I've attached the link to the problem below. Plz help.  NA1_Project_IDW_01.2014_Fall.pdf

int(int(y, 0 <= y, x^2+y^2+z^2 <= 1));

Error, (in int) integration range or variable must be specified in the second argument, got 0 <= y

int(int(y, y = 0, x^2+y^2+z^2 = 1));

Error, (in int) integration range or variable must be specified in the second argument, got y = 0

hi.i am a problem with following dsolve.please help me....thanks alot

dsys3 := {10*f2(x)+12*(diff(f1(x), x))+14*f3(x) = 0, 2*(diff(f1(x), x, x))+4*(diff(f2(x), x))+6*(diff(f3(x), x)) = 0, 16*(diff(f3(x), x, x, x, x))+19*(diff(f3(x), x, x))+22*(diff(f1(x), x))+25*f2(x)+27*f3(x)+29*f3(x)+31+32 = 0, f1(0) = 0, f1(1) = 0, f2(0) = 0, f2(1) = 0, f3(0) = 0, f3(1) = 0, ((D@@1)(f1))(0) = 0, ((D@@1)(f1))(1) = 0, ((D@@1)(f2))(0) = 0, ((D@@1)(f2))(1) = 0, ((D@@1)(f3))(0) = 0, ((D@@1)(f3))(1) = 0}; dsol5 := dsolve(dsys3, 'maxmesh' = 500, numeric, range = 0 .. 1, abserr = .1, output = listprocedure); fy3 := eval(f3(x), dsol5); fy2 := eval(f2(x), dsol5); fy1 := eval(f1(x), dsol5)ERROR.mw


restart:

m:=2; k:=75.11; L:=3; a=k-m*L; b:=k+m*L-1;

m := 2

k := 75.11

L := 3

a = 69.11

b := 80.11

z:=(k*m)/snr;

z := 150.22/snr

z1:=z^((b+1)/2);

z1 := 0.1893190041e89*(1/snr)^40.55500000

x:=z1/(0.693*GAMMA(m*L)*GAMMA(k));

x := 0.4283082808e-21*(1/snr)^40.55500000

me:=MeijerG([[1-a/2,1+a/2,1+(b+1)/2,1+(b+1)/2],[]],[[1+(b+1)/2],[(b+1)/2]],(1/z));

me := MeijerG([[1.-.5000000000*a, 1.+.5000000000*a, 41.55500000, 41.55500000], []], [[41.55500000], [40.55500000]], 0.6656903209e-2*snr)

cap:=x*me;

cap := 0.4283082808e-21*(1/snr)^40.55500000*MeijerG([[1.-.5000000000*a, 1.+.5000000000*a, 41.55500000, 41.55500000], []], [[41.55500000], [40.55500000]], 0.6656903209e-2*snr)

with(plots):

Warning, the name changecoords has been redefined

plot(cap,snr=1..20);

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Error, empty plot

 

 

 

 

Just a begineer in maple and dont know how to rectify this error.

any help..???

Download c_ora.mw

How we use Gamma function...

October 26 2014 oguner 0

Hi!


Please find my Maple-worksheet attached below.

 

How do I solve this problem? I can not drawn it.

I would really appriciate if somebody could help me. 

Hi,

I've noticed there are settings to set the type of index for spinors or gauge index in the physics package. i.e Setup(spinorindices=lowercaselatin). I also notice there is a setting for specifying the form of tetrads. 

I cannot find any further documention or examples on how to use these functions. Could anyone point me in the direction of a text or help function as to how these are implemented. 

Simple examples of things I am trying to do:

> with(Physics); Setup(spinorindices=lowercaselatin, metric = <some_line_element>)

> tetrad[`mu`,`~a`] = Matrix(<some tetrad matrix>) 

> Define(%)

I recieve the following error: invalid input: unknown uses a 2nd argument, a, which is missing.

I am hoping for a tensor that uses the metric to raise/lower the `mu` component and the minkowskian metric to raise/lower the `a` component. 

If there is further documentation that I am missing, I'm happy to check that out instead of asking lots of questions here. 

Thanks again.



This is my code for the Extended Euclidean Algorthim which should return integer l, polynomials pi,ri,si,ti for 0<=i<=l+1. And polynomial qi for 1<=i<=l such that si(f)+ti(g) = ri and sl(f)+tl(g)=rl=GCD(f,g).
The problem is, I keep getting division by zero. Also it evaluates pi = lcoeff(ri-1 - qiri) to be zero, everytime. Even when I remove this it still says there is a division of zero, which must be coming from qi:=quo(ri-1,ri, x); however I do not know why considering the requirements for the loop are that r[i] not equal zero. I really could use a fresh pair of eyes to see what I've done wrong. Any help would be greatly appreciated!!

Hello,

I wanted to get the following function integrated with Maple 17:

I used the following command to get a numerical solution for my choise of limits:

Unfortunately, I just get the Integral itself back. Also, taking pi/2 as the upper limit for x does improve anything. I also tried the AllSolutions option but it does not help as well as first trying to integrate only over y and leaving x as it is in order to get at least one integration done.

I hope someone can help. I do not necessarily need to solve it for myself, so if someone gets the result and posts it here, I'm okay with that. Anyway, being able to calculate it myself would be even better.

My instructor gave me the problem lim as x goes to 0 of ((2 + x)^3 +8)/x I can't figure out how to get the lim as x goes to, to show up.  There is no button for it in the expressions pallette like there is for things like the piecewise function. My instructor won't help me.  Is there a basic guide I can buy or something.  This software isn't very intuitive. 

I read this, but there was nothing on how to write a help associated with it.

Does anyone know where I can find it?

 

Many thanks,

 

casperyc

Hello.

I have a line integral and i want to calculate and graph this line integral.

The line integral comes from a physical problem, the integrand is good in the interval [0, 2*Pi] and the value of the integrand at zero = the value of the integrand at 2*Pi.

The problem is when i use the trapizidal rule to calculate the line integral.

The results is so bad, i.e.  the value of the line integral at zero not equal to the value of the line integral at 2* Pi.

where is the problem.

Any one could help me.

Dear all

I want your help in a problem.I want to substitute in a summarization ,the variables for Vi and ξi.Because the number of variables are more than 200 I want to know if there is a way to take them from the excel sheet and put the to my program.attached are the maple worksheet and the variables table

P.s. i have done it for 44 variables

ex4_lista_CSTR.mw

Variáveis

 

``

restart;

F[A][0] := 43, 4;

43, 4

 

802, 8

 

0

 

71, 87

(1.1)

C[P][A] := 35;

35

 

18

 

46

 

19, 5

(1.2)

deltaC[P] := -C[P][A]-C[P][B]+C[P][C];

-7

(1.3)

V := 40, 1

40, 1

(1.4)

v[A][0] := 46, 62;

46, 62

 

46, 62

 

233, 1

(1.5)

v[0] := v[A][0]+v[M][0]+v[B][0];

325, 125

(1.6)

H[A][ref] := -66600;

-66600

 

-123000

 

-226000

(1.7)

deltaH[R][ref] := -H[A][ref]-H[B][ref]+H[C][ref];

-36400

(1.8)

deltaH[R] := deltaH[R][ref]+deltaC[P]*(T-T[ref]);

-36400-7*T+7*T[ref]

(1.9)

``

k := 16, 96*10^12*exp(-32400/(R_*T));

16, 96000000000000*exp(-32400/(R_*T))

(1.10)

R_ := 1, 987;

1, 987

(1.11)

C[A][0] := F[A][0]/v[0];

(43, 4)/(325, 125)

(1.12)

T[0] := 75;

75

(1.13)

T[ref] := 68;

68

(1.14)

 

Balanço Molar

 

r[A] := -k*C[A][0]*(1-X[MA](T));

-(16, 96000000000000*exp(-32400/((1, 987)*T)))*(43, 4)*(1-X[MA](T))/(325, 125)

(2.1)

``

EQ1 := X[MA](T) = V*k/(V*k+v[0]);

X[MA](T) = (40, 1)*(16, 96000000000000*exp(-32400/((1, 987)*T)))/((40, 1)*(16, 96000000000000*exp(-32400/((1, 987)*T)))+(325, 125))

(2.2)

``

Balanço de Energia

 

r[A] := -k*C[A][0]*(1-X[EA](T));

-(16, 96000000000000*exp(-32400/((1, 987)*T)))*(43, 4)*(1-X[EA](T))/(325, 125)

(3.1)

``

EQ2 := X[EA](T) = 1-(C[P][A]*F[A][0]+C[P][B]*F[B][0]+C[P][C]*F[C][0])*(T-T[0])/(deltaH[R]*V*k*C[A][0]);

X[EA](T) = 1-(15941, 284)*(T-75)*(325, 125)/((-35924-7*T)*(40, 1)*(16, 96000000000000*exp(-32400/((1, 987)*T)))*(43, 4))

(3.2)

``

``



Download ex4_lista_CSTR.mw

 

Dear Maple enthusiasts,

I am unable to find a working method to solve a system of 8 equations, of which 4 are differential equations. The system contains 8 unknown variables and the goal is to find an expression for each of these variables as a function of the time t. I have attached the code of my project at the bottom of this message.

I have tried the following:

  1. Using solve/dsolve to solve all 8 equations at once. This results in Maple eating up all of my memory and never finishing its calculations.
  2. First using solve to solve the 4 non-differential equations so that I get 4 out of 8 variables as a function of the 4 remaining variables. This results in an expression containing RootOf() for each of the 4 veriables I'm solving for, which prevents me from using these expressions in the 4 remaining differential equations.
  3. First using dsolve to solve the differential equations, which gives once again an expression for 4 variables as a function of the 4 remaining variables. I then use solve to solve the 4 remaining equations with the new found expressions. This results in an extremely long solution for each of the variables.

The code below contains the 3rd option I tried.

Any help or suggestions would be greatly appreciated. I have been scratching my head so much that I'm getting bald and whatever I search for on google or in the Maple help, I can't find a good reference to a system of differential equations together with other equations.

 

 

restart:

PARK - Mixed control

 

 

Input parameters

 

 

Projected interface area (m²)

A_int:=0.025^2*Pi:

 

Temperature of the process (K)

T_proc:=1873:

 

Densities (kg/m³)

Rho_m:=7000: metal

Rho_s:=2850: slag

 

Masses (kg)

W_m:=0.5: metal

W_s:=0.075: slag

 

Mass transfer coefficients (m/s)

m_Al:=3*10^(-4):

m_Si:=3*10^(-4):

m_SiO2:=3*10^(-5):

m_Al2O3:=3*10^(-5):

 

Weight percentages in bulk at t=0 (%)

Pct_Al_b0:=0.3:

Pct_Si_b0:=0:

Pct_SiO2_b0:=5:

Pct_Al2O3_b0:=50:

 

Weight percentages in bulk at equilibrium (%)

Pct_Al_beq:=0.132:

Pct_Si_beq:=0.131:

Pct_SiO2_beq:=3.13:

Pct_Al2O3_beq:=52.12:

 

Weight percentages at the interface (%)

Constants

 

 

Atomic weights (g/mol)

AW_Al:=26.9815385:

AW_Si:=28.085:

AW_O:=15.999:

AW_Mg:=24.305:

AW_Ca:=40.078:

 

Molecular weights (g/mol)

MW_SiO2:=AW_Si+2*AW_O:

MW_Al2O3:=2*AW_Al+3*AW_O:

MW_MgO:=AW_Mg+AW_O:

MW_CaO:=AW_Ca+AW_O:

 

Gas constant (m³*Pa/[K*mol])

R_cst:=8.3144621:

 

Variables

 

 

with(PDEtools):
declare((Pct_Al_b(t),Pct_Al_i(t),Pct_Si_b(t),Pct_Si_i(t),Pct_SiO2_b(t),Pct_SiO2_i(t),Pct_Al2O3_b(t),Pct_Al2O3_i(t))(t),prime=t):

Equations

 

4 rate equations

 

 

Rate_eq1:=diff(Pct_Al_b(t),t)=-A_int*Rho_m*m_Al/W_m*(Pct_Al_b(t)-Pct_Al_i(t));

 

Rate_eq2:=diff(Pct_Si_b(t),t)=-A_int*Rho_m*m_Si/W_m*(Pct_Si_b(t)-Pct_Si_i(t));

 

Rate_eq3:=diff(Pct_SiO2_b(t),t)=-A_int*Rho_s*m_SiO2/W_s*(Pct_SiO2_b(t)-Pct_SiO2_i(t));

 

Rate_eq4:=diff(Pct_Al2O3_b(t),t)=-A_int*Rho_s*m_Al2O3/W_s*(Pct_Al2O3_b(t)-Pct_Al2O3_i(t));

 

3 mass balance equations

 

 

Mass_eq1:=0=(Pct_Al_b(t)-Pct_Al_i(t))+4*AW_Al/(3*AW_Si)*(Pct_Si_b(t)-Pct_Si_i(t));

 

Mass_eq2:=0=(Pct_Al_b(t)-Pct_Al_i(t))+4*Rho_s*m_SiO2*W_m*AW_Al/(3*Rho_m*m_Al*W_s*MW_SiO2)*(Pct_SiO2_b(t)-Pct_SiO2_i(t));

 

Mass_eq3:=0=(Pct_Al_b(t)-Pct_Al_i(t))+2*Rho_s*m_Al2O3*W_m*AW_Al/(Rho_m*m_Al*W_s*MW_Al2O3)*(Pct_Al2O3_b(t)-Pct_Al2O3_i(t));

 

1 local equilibrium equation

 

 

Gibbs free energy of the reaction when all of the reactants and products are in their standard states (J/mol). Al and Si activities are in 1 wt pct standard state in liquid Fe. SiO2 and Al2O3 activities are in respect to pure solid state.

 

delta_G0:=-720680+133*T_proc:

 

Expression of mole fractions as a function of weight percentages (whereby MgO is not taken into account, but instead replaced by CaO ?)

x_Al2O3_i(t):=(Pct_Al2O3_i(t)/MW_Al2O3)/(Pct_Al2O3_i(t)/MW_Al2O3 + Pct_SiO2_i(t)/MW_SiO2 + (100-Pct_SiO2_i(t)-Pct_Al2O3_i(t))/MW_CaO);
x_SiO2_i(t):=(Pct_SiO2_i(t)/MW_SiO2)/(Pct_Al2O3_i(t)/MW_Al2O3 + Pct_SiO2_i(t)/MW_SiO2 + (100-Pct_SiO2_i(t)-Pct_Al2O3_i(t))/MW_CaO);

 

Activity coefficients

Gamma_Al_Hry:=1: because very low percentage present  during the process (~Henry's law)

Gamma_Si_Hry:=1: because very low percentage present  during the process (~Henry's law)

Gamma_Al2O3_Ra:=1: temporary value!

Gamma_SiO2_Ra:=10^(-4.85279678314968+0.457486603678622*Pct_SiO2_b(t)); very small activity coefficient?
plot(10^(-4.85279678314968+0.457486603678622*Pct_SiO2_b),Pct_SiO2_b=3..7);

 

Activities of components

a_Al_Hry:=Gamma_Al_Hry*Pct_Al_i(t);
a_Si_Hry:=Gamma_Si_Hry*Pct_Si_i(t);
a_Al2O3_Ra:=Gamma_Al2O3_Ra*x_Al2O3_i(t);
a_SiO2_Ra:=Gamma_SiO2_Ra*x_SiO2_i(t);

 

Expressions for the equilibrium constant K

K_cst:=exp(-delta_G0/(R_cst*T_proc));

Equil_eq:=0=K_cst*a_Al_Hry^4*a_SiO2_Ra^3-a_Si_Hry^3*a_Al2O3_Ra^2;

 

Output

 

 

with(ListTools):
dsys:=Rate_eq1,Rate_eq2,Rate_eq3,Rate_eq4:
dvars:={Pct_Al2O3_b(t),Pct_SiO2_b(t),Pct_Al_b(t),Pct_Si_b(t)}:
dconds:=Pct_Al2O3_b(0)=Pct_Al2O3_b0,Pct_SiO2_b(0)=Pct_SiO2_b0,Pct_Si_b(0)=Pct_Si_b0,Pct_Al_b(0)=Pct_Al_b0:
dsol:=dsolve({dsys,dconds},dvars):

Pct_Al2O3_b(t):=rhs(select(has,dsol,Pct_Al2O3_b)[1]);
Pct_Al_b(t):=rhs(select(has,dsol,Pct_Al_b)[1]);
Pct_SiO2_b(t):=rhs(select(has,dsol,Pct_SiO2_b)[1]);
Pct_Si_b(t):=rhs(select(has,dsol,Pct_Si_b)[1]);

sys:={Equil_eq,Mass_eq1,Mass_eq2,Mass_eq3}:
vars:={Pct_Al2O3_i(t),Pct_SiO2_i(t),Pct_Al_i(t),Pct_Si_i(t)}:
sol:=solve(sys,vars);

,


Download Park_-_mixed_control_model.mw

1 2 3 4 5 6 7 Last Page 1 of 157