MaplePrimes Questions

Hi MaplePrimers!

I have a simulation in MapleSIM, exported as a compiled procedure in maple using -LinkModel(), and -GetCompiledProc.

I'm trying to do parameter estimation on my MapleSIM model.  Within a optimization scheme, I call the MapleSIM model, and it will output a curve.  Using a least squares method, I compare this measurements to synthetic experimental data (I know the actual values), and generate an objective function.  The optimization algorithm will try different parameter values, and try to minimze the objective function.  When the curves are exactly the same, the objective function will be zero.

The problem I am having is certain parameter sets will cause the model to require very small steps.  I wish to put a timeout on these experiments, because speed is important.  However, I would also like to see the results up to the point of requiring very small steps.  For timeout, I was using code along the lines of:

out:= timelimit(30,cProc(params = PData)); #simulate with 30s limit

where PData are the parameter guessses, and cProc is the compiled MapleSim model.

I would like 'out' to be assigned whatever the results were after 30 seconds, even if the model had not finished integrating.

 

Thanks in advance for any help!

I am trying to solve a set of equations for a Fluid dynamics problem and I cannot get a result...Any ideas why?

rho := 1.184;
nu := 1.562*10^(-5);
ID := .15;
L := 24.5;
Kl := 12.69;
Ho := 50.52;
a := 2.1*10^(-5);
E := 0.1e-2; alpha := 1.05;

sys := {Re = ID*V/nu, hl = (f*L/ID+Kl)*V^2/(2*9.81), Vflow = (1/4)*Pi*ID^2*V, Hrequired = alpha*V^2/(2*9.81)+hl, Hrequired = -a*Vflow^2+Ho, 1/sqrt(f) = -1.8*log[10](6.9/Re+(E/(3.7))^1.11)};

solve(sys*{Re, V, f, hl, Vflow, Hrequired});
%;
Error, (in unknown) invalid input: Utilities:-SetEquations expects its 2nd argument, equations, to be of type set({boolean, algebraic, relation}), but received {{Re = (9603072983/1000000)*V, hl = (5096839959/100000000000)*((1633333333/10000000)*f+1269/100)*V^2, Vflow = (9/1600)*Pi*V, Hrequired = (5351681957/100000000000)*V^2+hl, Hrequired = -(21/1000000)*Vflow^2+1263/25, 1/f^(1/2) = -(9/5)*ln((69/10)/Re+27367561/250000000000)/ln(10)}}

 

Dear All,

 

I have a .txt file with a single line. I tried to import it using ImportMatrix commnad (e.g. ImportMatrix(filename)) but always got the incomplete data, 

I attach the file for further reference:

ConservationEq.txt 

 

Anything I am missing ?

 

Regards,

 

Satya

I know how to define a procedure and use print() as follows:

test := proc (x)
  print("x is equal to: ");
  x
end proc

This displays as follows:
test(2)

"x is equal to: "

2

But i would like to appear as follows:

x is equal to: 2

 

Where the "x is equal to: "-part is standard a "text-mode-block" with green color.

Can i accomplish this in Maple, and can i do more advanced formatting?

 

Best regards,

Martin

hi,

    In my note,i use Simplify or map(Simplify,eqs) to make the expression more simple,but i meet a fail,the answers i got lies two diffrent between Eq.(8) and Eq.(9) caused by last term ,i guess it's a bug in using Physics package,if not,how can i do, please tell me.

thanks.

NULL

restart; with(Physics); Setup(mathematicalnotation = true); Physics:-Version()[2]

`2014, January 6, 3:40 hours`

(1)

Setup(op = {a, ap})

`* Partial match of  'op' against keyword 'quantumoperators'`

 

[quantumoperators = {a, ap}]

(2)

ap := Dagger(a)

Physics:-Dagger(a)

(3)

Setup(alg = {%Commutator(a, ap) = 1})

`* Partial match of  'alg' against keyword 'algebrarules'`

 

[algebrarules = {%Commutator(a, %Dagger(a)) = 1}]

(4)

``

N := Physics:-`*`(ap, a)

Physics:-`*`(Physics:-Dagger(a), a)

(5)

K__0 := Physics:-`*`(ap, a)+1/2; 1; K__d := Physics:-`*`(a, sqrt(N)); 1; K__u := Dagger(K__d)

Physics:-`*`(Physics:-Dagger(a), a)+1/2

 

Physics:-`*`(a, Physics:-`*`(Physics:-Dagger(a), a)^(1/2))

 

Physics:-`*`(Physics:-`*`(Physics:-Dagger(a), a)^(1/2), Physics:-Dagger(a))

(6)

C := K__0^2-Physics:-`*`(Physics:-`*`(K__d, K__u)+Physics:-`*`(K__u, K__d), 1/2)

Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a)+1/2, 2)-(1/2)*Physics:-`*`(a, Physics:-Dagger(a), a, Physics:-Dagger(a))-(1/2)*Physics:-`*`(Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a), 1/2), Physics:-Dagger(a), a, Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a), 1/2))

(7)

ans1 := Simplify(C)

1/4-(3/2)*Physics:-`*`(a, Physics:-Dagger(a))+(1/2)*Physics:-`*`(Physics:-`^`(a, 2), Physics:-`^`(Physics:-Dagger(a), 2))-(1/2)*Physics:-`^`(-1+Physics:-`*`(a, Physics:-Dagger(a)), 3/2)

(8)

ans2 := map(Simplify, C)

1/4-2*Physics:-`*`(a, Physics:-Dagger(a))+Physics:-`*`(Physics:-`^`(a, 2), Physics:-`^`(Physics:-Dagger(a), 2))-(1/2)*Physics:-`*`(a, Physics:-Dagger(a), a, Physics:-Dagger(a))-(1/2)*Physics:-`*`(Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a), 1/2), Physics:-Dagger(a), a, Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a), 1/2))

(9)

Term3 := op(3, C)

-(1/2)*Physics:-`*`(Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a), 1/2), Physics:-Dagger(a), a, Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a), 1/2))

(10)

Simplify(Term3) = -Physics:-`*`(Physics:-`*`(ap, a)^2, 1/2)

-(1/2)*Physics:-`*`(Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a), 1/2), Physics:-Dagger(a), a, Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a), 1/2)) = -(1/2)*Physics:-`^`(Physics:-`*`(Physics:-Dagger(a), a), 2)

(11)

ans3 := Simplify(subsop(3 = -Physics:-`*`(Physics:-`*`(ap, a)^2, 1/2), C))

-1/4

(12)

  
"here,we can find a quite difference between Eq.(8) and Eq.(9)."

obviously,there lies a wrong result at last term in Eq.(8).

  The question is how we can simplify the style as last term in Eq.(9) even the soft can work correctly.

  yes,i want get a result from lhs(11) to rhs(11) through 'Simplify',in fact,in quantum operator computation,we can meet much more like sqrt(ap*a)*ap*a*sqrt(ap*a),exp(ap*a)*ap*a*exp(-ap*a),sin(ap*a)*a*ap*sin(ap*a),etc.if happen,can we  make this more simple with soft?

 

NULL

NULL



Download question_13.12.29.mw

Why does the act of multiplying a vector or a matrix with zero produce not a zero vector or a zero matrix, but in both cases zero scalarly? An example:

Vector(4),
Matrix(4),
0*Vector(4),
0*Matrix(4);

Mathematically it makes no proper sense, and annoyingly it forces one to make some special code-adjustments to treat differently nonzero- and zero multiplication.

Important (note added): The problem is present only when the Physics package is loaded, see comment below.

Complex conjugation of a product of Grassmannians is defined to reverse the order of the multiplicands (while also complex conjugating each multiplicand by itself, of course). That does not seem to be implemented in the Physics package: The code

with(Physics):
Setup(
   mathematicalnotation = true,
   anticommutativepre   = theta
):
a := theta1*theta2;
b := conjugate(a);
c := evalc(b);

produces for a, b, and c the following results:

In b and c, the order of the multiplicands should be the reverse, or, equivalently, the signs of b and c should be the opposite. Is it due to an error, or due to not being implemented yet, or have I simply misunderstood something?

The following code of mine, which no doubt may be improved, performs this generalized conjugation (note that reversing a product of c-number-valued, i.e., commutative, quantities is, of course, inconsequential, and thus usual complex conjugation is maintained):

Conj := proc(x::algebraic)
    local expr;
    expr := expand(x);
    if   type(expr,`+`) then map(Conj,expr)
    elif type(expr,`*`) then `*`(ListTools:-Reverse(map(Conj,[op(expr)]))[]);
    else conjugate(expr)
    end if
end proc:

I want to define a band matrix using n vectors. Detial given maple sheet. please help me

Help.mw

I want to define a matrix of M by M which have some condition. detail given in maple file. please help me.

Help_Maple-1.mw

I explain the required matrix by taking some example hope you will be understand. Please make it quickly... I will be very thank full. Help_Maple-1.mw

I wan to define a square matrix for M and r detial given in Maple sheet. Please Help....Help_Maple.mwHelp_Maple.mw

Is it possible that this expression has an elementary one (specifically the dilog's):

Y0:=(1/16)*(s*t*(exp(2*t)*s+exp(4*t)+1)*ln((exp(2*t)*s-(-s^2+1)^(1/2)+1)^16*(1+(-s^2+1)^(1/2))^16/((exp(2*t)*s+(-s^2+1)^(1/2)+1)^16*(1-(-s^2+1)^(1/2))^16))+s^3*t*(exp(4*t)+1)*ln((exp(2*t)*s-(-s^2+1)^(1/2)+1)^8*(1+(-s^2+1)^(1/2))^8/((exp(2*t)*s+(-s^2+1)^(1/2)+1)^8*(1-(-s^2+1)^(1/2))^8))+exp(2*t)*t*ln((exp(2*t)*s-(-s^2+1)^(1/2)+1)^32*(1+(-s^2+1)^(1/2))^32/((exp(2*t)*s+(-s^2+1)^(1/2)+1)^32*(1-(-s^2+1)^(1/2))^32))+4*((exp(4*t)+1)*s+2*exp(2*t))*(s^2+2)*dilog((-exp(2*t)*s+(-s^2+1)^(1/2)-1)/(-1+(-s^2+1)^(1/2)))-4*((exp(4*t)+1)*s+2*exp(2*t))*(s^2+2)*dilog((exp(2*t)*s+(-s^2+1)^(1/2)+1)/(1+(-s^2+1)^(1/2)))+((32*s^2*t+64*t)*exp(2*t)+16*(((t+1/8)*s^2+2*t+2)*exp(4*t)-(5/4)*s*exp(-2*t)-(1/8)*exp(-4*t)*s^2+(5/4)*s*exp(6*t)+(1/8)*s^2*exp(8*t)+(t-1/8)*s^2-2+2*t)*s)*arctanh((exp(2*t)-1)*(-1+s)/((-s^2+1)^(1/2)*(exp(2*t)+1)))+8*(-s^2+1)^(1/2)*((1/8)*s*(exp(4*t)+1)*ln((exp(4*t)*s+2*exp(2*t)+s)^12/s^12)+(1/8)*exp(2*t)*ln((exp(4*t)*s+2*exp(2*t)+s)^24/s^24)+(s^2-6*t-3)*exp(2*t)+((-(1/8)*s^2-3*t)*exp(4*t)+s*exp(-2*t)+(1/8)*exp(-4*t)*s^2+s*exp(6*t)+(1/8)*s^2*exp(8*t)-(1/8)*s^2-3*t)*s))/((s*exp(-2*t)+exp(2*t)*s+2)*(exp(4*t)*s+2*exp(2*t)+s)*((-s^2+1)^(1/2)+2*arctanh((-1+s)/(-s^2+1)^(1/2))))

Also I'm wondering since Y0 should solve the ode

-(diff(diff(y(t), t), t))+(4-12/(1+s*cosh(2*t))+8*(-s^2+1)/(1+s*cosh(2*t))^2)*y(t) = C/(1+s*cosh(2*t))

with some constant C but I only get rubbish.

I ask this because I found that in another context this seems to be correct:

f1:=-(1/12)*Pi^2*((-s^2+1)^(1/2)-arccosh(1/s))/(-s^2+1)^(3/2)+(1/12)*arccosh(1/s)^3/(-s^2+1)^(3/2)-(1/4)*arccosh(1/s)^2/(-s^2+1)

f2:=(1/2)*((-s^2+1)^(1/2)*(polylog(2, s/(-1+(-s^2+1)^(1/2)))+polylog(2, -s/(1+(-s^2+1)^(1/2))))-polylog(3, s/(-1+(-s^2+1)^(1/2)))+polylog(3, -s/(1+(-s^2+1)^(1/2))))/(-s^2+1)^(3/2)

and f1=f2

but maple doesnt convert it.

Also maple has trouble to convert

2*arctanh(sqrt((1-s)/(1+s)))=arccosh(1/s)

everywhere: 0<s<1

Aslam-u-Alikum. How are you. I want to make band matrix by using two vector. Detail given in Maple fine also. Please help me urgent.Help.mw

Is it possible to find the limit
limit(int(x*cos(x)/(1+3*sin(n*x)^2), x = 0 .. Pi), n = infinity)assuming n::posint
with Maple?
Calculations suggest the one equals -1.

Hello

I calculated following two expressions, x1,and x2.

x1:=map(f,a+b);

x2:=map(f,y=a+b);

 

The results of these are

f(a) + f(b)

f(y) = f(a + b)

for each. And, I can understand the logic of this.

 

If I want to derive the result of x2 as f(y)=f(a)+f(b), how should I do about x2?

Isn't there other way than to write

map(f, lhs(x2))=map(f,rhs(x2))

?

Please teach me this.

Thank you in advance.

Taro

 

 

First 1476 1477 1478 1479 1480 1481 1482 Last Page 1478 of 2426