MaplePrimes Questions

¿que libros me recomiendan para aprender mas sobre matematica computacional?  

 

Hello every one,

restart;with(stats):

with(stats[statplots]):
with(plots):

x1_values:=[0.1, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80];

x2_values:=[1, 2, 3, 4, 5, 6, 7, 8];

x3_values:=[11, 12, 13, 14, 15, 16, 17, 18];

x4_values:=[10, 20, 30, 40, 50, 60, 70, 80];

y_values:=[30, 40, 60, 70, 90, 120, 150, 200];

How to fit the above data into the following equation

y=a+b*x1+c*x2+d*x3+e*x4+f*x1^2+g*x2^2+h*x3^2+i*x4^2+j*x1*x2+k*x1*x3+l*x1*x4

+m*x2*x3+n*x2*x4+p*x3*x4;

Thanks

 

 

 

@Markiyan Hirnyk 

 

First try, i change to 

result1 := Optimization:-Minimize([ans>=0, ans<=0],initialpoint=[.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003], feasibilitytolerance=0.01);

Error, (in Optimization:-Minimize) objective function must be an algebraic expression or procedure

Second try, i change to use ans for >=0, ans2 <=0

ans:=proc(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12) sol(parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);
add((X(tim[i])-x11[i])^2,i=1..N)+add((Y(tim[i])-y11[i])^2,i=1..N)+add((Z(tim[i])-z11[i])^2,i=1..N)+add((U(tim[i])-u11[i])^2>=0,i=1..N)
end proc;
ans2:=proc(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12) sol(parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);
add((X(tim[i])-x11[i])^2,i=1..N)+add((Y(tim[i])-y11[i])^2,i=1..N)+add((Z(tim[i])-z11[i])^2,i=1..N)+add((U(tim[i])-u11[i])^2<=0,i=1..N)
end proc;
ans(.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003);
result1 := Optimization:-Minimize([ans, ans2],initialpoint=[.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003], feasibilitytolerance=0.01);

Error, (in Optimization:-Minimize) objective function must be an algebraic expression or procedure

 

 

x11 := [0.208408965651696e-3, -0.157194487523421e-2, -0.294739401402979e-2, 0.788206708183853e-2, 0.499394753201753e-2, 0.191468321959759e-3, 0.504980449104750e-2, 0.222150494088535e-2, 0.132091821964287e-2, 0.161118434883258e-2, -0.281236534046873e-2, -0.398055875132037e-2, -0.111753680372819e-1, 0.588868146012489e-2, -0.354191562612469e-2, 0.984082837373291e-3, -0.116041186868374e-1, 0.603027845850267e-3, -0.448778128168742e-2, -0.127561485214862e-1, -0.412027655195339e-2, 0.379387381798949e-2, -0.602550446997765e-2, -0.605986284736216e-2, -0.751396992404410e-2, 0.633613424008655e-2, -0.677581832613623e-2]:
y11 := [ -21321.9719565717, 231.709204951251, 1527.92905167191, -32.8508507060675, 54.9408176234139, -99.4222178124229, -675.771433486265, 42.0838668074923, -12559.3183308951, 5.21412214166344*10^5, 1110.50031772203, 3.67149699000155, -108.543878970269, -8.48861069398811, -521.810552387313, 26.4792411876883, -8.32240296737599, -1085.40982521906, -44.1390030597906, -203.891397612798, -56.3746416571417, -218.205643256096, -178.991498697065, -42.2468018350386, .328546922634921, -1883.18308996621, 111.747881085748]:
z11 := [ 1549.88755331800, -329.861725802688, 8.54200301129155, -283.381775745327, -54.5469129127573, 1875.94875597129, -16.2230517860850, 6084.82381954832, 1146.15489803104, -456.460512914647, 104.533252701641, 16.3998365630734, 11.5710907832054, -175.370276462696, 33.8045539958636, 2029.50029336951, 1387.92643570857, 9.54717543291120, -1999.09590358328, 29.7628085078953, 2.58210333216737*10^6, 57.7969622731082, -6.42551196941394, -8549.23677077892, -49.0081775323244, -72.5156360537114, 183.539911458475]: 
u11 := [7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7];
a1 := Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t)+k4*u1(t);
b1 := Diff(y1(t),t) = k5*x1(t)+ k6*y1(t)+ k7*z1(t)+k8*u1(t);
c1 := Diff(z1(t),t) = k9*x1(t)+ k10*y1(t)+ k11*z1(t)+k12*u1(t);
d1 := Diff(u1(t),t) = 0;
ICS:=x1(1)=x11[1],y1(1)=y11[1],z1(1)=z11[1],u1(1)=u11[1];
sol:=dsolve({a1,b1,c1,d1, a2,b2,c2,d2,ICS}, numeric, method=rkf45, parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12],output=listprocedure);
X,Y,Z,U:=op(subs(sol,[x1(t),y1(t),z1(t),u1(t)]));
tim := [seq(n, n=1..27)];
N:=nops(tim):
ans:=proc(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12) sol(parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);
add((X(tim[i])-x11[i])^2,i=1..N)+add((Y(tim[i])-y11[i])^2,i=1..N)+add((Z(tim[i])-z11[i])^2,i=1..N)+add((U(tim[i])-u11[i])^2,i=1..N)
end proc;
ans(.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003);
result1 := Optimization:-Minimize([ans>=0, ans<=0],initialpoint=[.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003], feasibilitytolerance=0.01);

Hi everyone, I'm trying to print out Collatz's Conjecture's steps for any given value with the following code but it takes forever and prints nothing. Any idea on how I can get it working ?

 

checkCollatzValue:=proc(val) local res, remaining;
while res <> 1 do
remaining = irem(val, 2); remaining;
if remaining = 0 then res = val / 2; else res = val * 3 + 1; fi;
res;
od;
end proc;

In my research a I need to solve the linear equation (getting its null space) under some constraints.

The matrix is given below:

 

The constraints shall be (x[1]...x[16]>0, x[17]...x[20] arbitary...)

The solutions shall actually be a canonical combination of a lot of vectors, (canonical combination means possitive sums of vectors). And I wish to get those vectors. is there a way that I could achieve this by Maple?

> restart;

> with(plots):

> dp := proc(X,Y)

>     X[1]*Y[1]+X[2]*Y[2];

> end:

> nrm := proc(X)

>     sqrt(dp(X,X));

> end:

> r:=[3*cos(u),3*sin(u)];

> lambda:=1;

>  f:=proc(X)

> local Xu,s,T,N,kappa,v,n,pr,v1,z;

> Xu := [diff(X[1],u),diff(X[2],u)];

> s := nrm(Xu);

> T:=[diff(X[1],u)/s,diff(X[2],u)/s];

> N:=[-T[2],T[1]];

> kappa:=simplify(dp(diff(T,u),N))/s;

> v:=int(kappa,u=0..u);

> z:=v;

> if z=0 then -1 else  v1:=z fi;

> n:=[cos(v1)*N[1]+sin(v1)*T[1],cos(v1)*N[2]+sin(v1)*T[2]];

> pr:=([r[1]+lambda*n[1],r[2]+lambda*n[2]]);

> end:

> plot([f(r)[1],f(r)[2],-18..18]);

 

can you please help me , I'm not sure what is going wrong.

When you use the slider without Do(%MathContainer1 = StandardError(Variance, R)):
everything works ok but when you add Do(%MathContainer1 = StandardError(Variance, R)):
Maple Crashes.....

Strange...

LL_102)_Covariance_M.mw

@Markiyan Hirnyk 

First try, i change to 

result1 := Optimization:-Minimize([ans>=0, ans<=0],initialpoint=[.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003], feasibilitytolerance=0.01);

Error, (in Optimization:-Minimize) objective function must be an algebraic expression or procedure

Second try, i change to use ans for >=0, ans2 <=0

ans:=proc(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12) sol(parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);
add((X(tim[i])-x11[i])^2,i=1..N)+add((Y(tim[i])-y11[i])^2,i=1..N)+add((Z(tim[i])-z11[i])^2,i=1..N)+add((U(tim[i])-u11[i])^2>=0,i=1..N)
end proc;
ans2:=proc(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12) sol(parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);
add((X(tim[i])-x11[i])^2,i=1..N)+add((Y(tim[i])-y11[i])^2,i=1..N)+add((Z(tim[i])-z11[i])^2,i=1..N)+add((U(tim[i])-u11[i])^2<=0,i=1..N)
end proc;
ans(.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003);
result1 := Optimization:-Minimize([ans, ans2],initialpoint=[.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003], feasibilitytolerance=0.01);

Error, (in Optimization:-Minimize) objective function must be an algebraic expression or procedure

 

 

x11 := [0.208408965651696e-3, -0.157194487523421e-2, -0.294739401402979e-2, 0.788206708183853e-2, 0.499394753201753e-2, 0.191468321959759e-3, 0.504980449104750e-2, 0.222150494088535e-2, 0.132091821964287e-2, 0.161118434883258e-2, -0.281236534046873e-2, -0.398055875132037e-2, -0.111753680372819e-1, 0.588868146012489e-2, -0.354191562612469e-2, 0.984082837373291e-3, -0.116041186868374e-1, 0.603027845850267e-3, -0.448778128168742e-2, -0.127561485214862e-1, -0.412027655195339e-2, 0.379387381798949e-2, -0.602550446997765e-2, -0.605986284736216e-2, -0.751396992404410e-2, 0.633613424008655e-2, -0.677581832613623e-2]:
y11 := [ -21321.9719565717, 231.709204951251, 1527.92905167191, -32.8508507060675, 54.9408176234139, -99.4222178124229, -675.771433486265, 42.0838668074923, -12559.3183308951, 5.21412214166344*10^5, 1110.50031772203, 3.67149699000155, -108.543878970269, -8.48861069398811, -521.810552387313, 26.4792411876883, -8.32240296737599, -1085.40982521906, -44.1390030597906, -203.891397612798, -56.3746416571417, -218.205643256096, -178.991498697065, -42.2468018350386, .328546922634921, -1883.18308996621, 111.747881085748]:
z11 := [ 1549.88755331800, -329.861725802688, 8.54200301129155, -283.381775745327, -54.5469129127573, 1875.94875597129, -16.2230517860850, 6084.82381954832, 1146.15489803104, -456.460512914647, 104.533252701641, 16.3998365630734, 11.5710907832054, -175.370276462696, 33.8045539958636, 2029.50029336951, 1387.92643570857, 9.54717543291120, -1999.09590358328, 29.7628085078953, 2.58210333216737*10^6, 57.7969622731082, -6.42551196941394, -8549.23677077892, -49.0081775323244, -72.5156360537114, 183.539911458475]:
u11 := [7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7];
a1 := Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t)+k4*u1(t);
b1 := Diff(y1(t),t) = k5*x1(t)+ k6*y1(t)+ k7*z1(t)+k8*u1(t);
c1 := Diff(z1(t),t) = k9*x1(t)+ k10*y1(t)+ k11*z1(t)+k12*u1(t);
d1 := Diff(u1(t),t) = 0;
ICS:=x1(1)=x11[1],y1(1)=y11[1],z1(1)=z11[1],u1(1)=u11[1];
sol:=dsolve({a1,b1,c1,d1, a2,b2,c2,d2,ICS}, numeric, method=rkf45, parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12],output=listprocedure);
X,Y,Z,U:=op(subs(sol,[x1(t),y1(t),z1(t),u1(t)]));
tim := [seq(n, n=1..27)];
N:=nops(tim):
ans:=proc(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12) sol(parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);
add((X(tim[i])-x11[i])^2,i=1..N)+add((Y(tim[i])-y11[i])^2,i=1..N)+add((Z(tim[i])-z11[i])^2,i=1..N)+add((U(tim[i])-u11[i])^2,i=1..N)
end proc;
ans(.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003);
result1 := Optimization:-Minimize([ans>=0, ans<=0],initialpoint=[.001,.002,.003,.001,.002,.003,.001,.002,.003,.003,.003,.003], feasibilitytolerance=0.01);

How can I get the Standard Errors of the covariance matrix in Maple?
I can simulate a covariance matrix in Maple as follows:

restart:
with(Statistics):
with(LinearAlgebra):

R := RandomMatrix(4, 4, generator = -15 .. 15, outputoptions = [datatype = float[8]]);
CovarianceMatrix(R);

but how do I find the standard errors?

EDIT:EDIT: I found what I was looking for. Thanks!

 

eq:=(V^(1-r/(r-s))*V*k/(r-2*s)+_C1)*V^(r/(r-s))=0;

 

equation 1

 

solve(eq,C1);

 

Can anyone tell me why nothing happens when I solve the above equation for C1.

I've been coming across this problem a few times lately, but sometimes when the equations are less complicated it does work from time to time. 

Any help would be greatly appreciated.

 

EDIT:  Thanks Markiyan Hirnyk

But I'm still having some trouble.

 

f:=t->(-r*t+s*t+V)^(r/(r-s));

eq2:=diff(C*f(t),t)+C*f(t)*r/(V+s*t-r*t)=s*k*t;

solve(eq2,C);

 


When I try solving eq2 nothing happens. 


This time C is just a variable I used and not one Maple generated.

So why doesn't it work with this particular equation?

 

 

hi,

     there is a common  differential equation in my maple note,the solution of the eq. can be expressed by

associated Legendre function(s),but i get a result by hypergeometric representation.how i can translate the later into a  single Legendre fun?

 Thank you in advance  

ode := 'sin(theta)*(diff(sin(theta)*(diff(Theta(theta), theta)), theta))'/Theta(theta)+l*(l+1)*sin(theta)^2 = m^2

sin(theta)*(diff(sin(theta)*(diff(Theta(theta), theta)), theta))/Theta(theta)+l*(l+1)*sin(theta)^2 = m^2

(1)

dsolve(ode)

Theta(theta) = _C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)/(1-cos(2*theta))^(1/2)+_C2*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/(1-cos(2*theta))^(1/2)

(2)

`assuming`([simplify(dsolve(ode))], [l::posint, m::integer, l >= m])

Theta(theta) = ((1/2)*cos(2*theta)-1/2)^((1/2)*m)*(sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)*_C1+2^(1/2)*(1-cos(2*theta))^(1/2)*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*_C2)/(1-cos(2*theta))^(1/2)

(3)

convert(Theta(theta) = _C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)/(1-cos(2*theta))^(1/2)+_C2*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/(1-cos(2*theta))^(1/2), `2F1`)

Theta(theta) = (1/2)*_C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*Pi^(1/2)*GAMMA(-(1/2)*m-(1/2)*l)*JacobiP(-(1/2)*m-(1/2)*l-1, 1/2, m, -cos(2*theta))/((1-cos(2*theta))^(1/2)*GAMMA(1/2-(1/2)*m-(1/2)*l))+_C2*Pi^(1/2)*GAMMA(1-(1/2)*m+(1/2)*l)*JacobiP(-(1/2)*m+(1/2)*l, -1/2, m, -cos(2*theta))*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/((1-cos(2*theta))^(1/2)*GAMMA(-(1/2)*m+(1/2)*l+1/2))

(4)

``

 

Download question_12.19.mw

 

Is there a way to play animations in maplets?

I can send an animation to a plotter, but don't know how to play it.  

Thanks, Rollie

Can anyone help me to transform a system of ODE into a power series solution. The system of ODE is as follows:

diff(f(eta), eta, eta, eta)+(diff(f(eta), eta, eta))*f(eta)+1 - (diff(f(eta), eta))^2=0

f(eta)*(diff(theta(eta), eta))+(1/Pr)*diff(theta(eta), eta, eta)=0

where Pr is the prendtl no.

The contents of the "list of list" are hidden... I want to display them in the worksheet without double cliking them to open them... what shall I do? Thank you.

I have a linear space spanned by the column vectors of:

I want to know its exact intersection of the first quadrant in 16 dimensional space (meaning Sum(a[i]*e[i]),i=1..16), how could I accomplish it? The output could possibly be the vectors defining the convex cone in higher dimensional space...

 

 

First 1490 1491 1492 1493 1494 1495 1496 Last Page 1492 of 2433