MaplePrimes Questions

Hello everyone! I was trying to draw a circle point by point using animate, but there's a catch: I'd like it to be created in front of the user, that is seeing every point being drawn in sequence.

Like this, but with the point leaving a trail behind him.

Can anyone help?

Hello,

I'm trying to evaluate if the matrizes are the same but i cant figure out why it say they are different.

 

restart;
with(DEtools);
DEplot(diff(y(t), t$2)-3*(diff(y(t), t))+2*y(t) = exp(t), [[y(0) = 0, (D(y))(0) = 2]], stepsize = .1, linecolor = black, thickness = 2);

 

Is there a way to enter a formula into the coloums to generate the output?
I did the Table of Values by Hand which will take a long time for real data.

Thanks in Advance

``

Example: Verifying Inverse Functions Numerically

 

"ex17f6(x):=(x-5)/(2):"

"ex17g6(x):=2 x+5:"

y3:

ex17f6(ex17g6(x))

x

(1.1)

y4:

ex17g6(ex17f6(x))

x

(1.2)

NULLNULL

 

Table 1: Table of Values

x

y3

y4

-2

-2

-2

-1

-1

-1

0

0

0

1

1

1

2

2

2

3

3

3

4

4

4

 

NULL


 

Download InverseNum.mw

Why are these functions not graphed correctly?
 

Example: Verifying Inverse Functions Graphically

 

``

"ex17f5(x):=2 x^(3)-1:"

"ex17g5(x):=((x+1)/(2))^(1/(3)):"

 

``


 

Download inverseExample.mw

Hi everyone, I have problem solving a given optimization problem using the Karush Khun Tucke conditions. The working is as follows:

restart;
with(linalg);
f := 49*x[1]+94*x[2]+90*x[3]+24*x[4]+6*x[5]+63*x[6]+17*x[7]+65*x[8]+72*x[9]+40*x[10]+67*x[11]+99*x[12]+97*x[13]+53*x[14]+22*x[15]+47*x[16]+60*x[17]+36*x[18]+54*x[19]+67*x[20]+46*x[21]+55*x[22]+42*x[23]+70*x[24];
49 x[1] + 94 x[2] + 90 x[3] + 24 x[4] + 6 x[5] + 63 x[6]

   + 17 x[7] + 65 x[8] + 72 x[9] + 40 x[10] + 67 x[11] + 99 x[12]

   + 97 x[13] + 53 x[14] + 22 x[15] + 47 x[16] + 60 x[17]

   + 36 x[18] + 54 x[19] + 67 x[20] + 46 x[21] + 55 x[22]

   + 42 x[23] + 70 x[24]
g[1] := x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10]+x[11]+x[12]-475;
  x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7] + x[8] + x[9]

     + x[10] + x[11] + x[12] - 475
g[2] := x[13]+x[14]+x[15]+x[16]+x[17]+x[18]+x[19]+x[20]+x[21]+x[22]+x[23]+x[24]-30;
 x[13] + x[14] + x[15] + x[16] + x[17] + x[18] + x[19] + x[20]

    + x[21] + x[22] + x[23] + x[24] - 30
for i from 3 to 26 do g[i] := -x[i] end do;
h[1] := 54-x[1];
                           54 - x[1]
h[2] := 30-x[2];
                           13 - x[2]
h[3] := 13-x[3];
                           13 - x[3]
h[4] := 41-x[4];
                           41 - x[4]
h[5] := 97-x[5];
                           97 - x[5]
h[6] := 11-x[6];
                           11 - x[6]
h[7] := 62-x[7];
                           62 - x[7]
h[8] := 59-x[8];
                           59 - x[8]
h[9] := 35-x[9];
                           35 - x[9]
h[10] := 42-x[10];
                           42 - x[10]
h[11] := 19-x[11];
                           19 - x[11]
h[12] := 12-x[12];
                           12 - x[12]
vars := [x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]];
[x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], 

  x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], 

  x[20], x[21], x[22], x[23], x[24]]
H := Hessian(f, vars);
Hessian(49 x[1] + 94 x[2] + 90 x[3] + 24 x[4] + 6 x[5] + 63 x[6]

   + 17 x[7] + 65 x[8] + 72 x[9] + 40 x[10] + 67 x[11] + 99 x[12]

   + 97 x[13] + 53 x[14] + 22 x[15] + 47 x[16] + 60 x[17]

   + 36 x[18] + 54 x[19] + 67 x[20] + 46 x[21] + 55 x[22]

   + 42 x[23] + 70 x[24], [x[1], x[2], x[3], x[4], x[5], x[6], 

  x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], 

  x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]])
grad_f := Del(f, vars);
Del(49 x[1] + 94 x[2] + 90 x[3] + 24 x[4] + 6 x[5] + 63 x[6]

   + 17 x[7] + 65 x[8] + 72 x[9] + 40 x[10] + 67 x[11] + 99 x[12]

   + 97 x[13] + 53 x[14] + 22 x[15] + 47 x[16] + 60 x[17]

   + 36 x[18] + 54 x[19] + 67 x[20] + 46 x[21] + 55 x[22]

   + 42 x[23] + 70 x[24], [x[1], x[2], x[3], x[4], x[5], x[6], 

  x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], 

  x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]])
for i to 26 do grad_g[i] := Del(g[i], vars) end do;
for i to 12 do grad_h[i] := Del(h[i], vars) end do;
eq[1] := grad_f+sum(mu[i]*g[i], i = 13 .. 26)+sum(lambda[i]*h[j], j = 1 .. 12) = 0;
Error, (in sum) summation variable previously assigned, second argument evaluates to 13 = 13 .. 37
eq[2] := g[i] <= 0;
                          -x[13] <= 0
eq[3] := h[j] <= 0;
                           h[j] <= 0
eq[4] := mu[i] >= 0;
                          0 <= mu[13]
eq[5] := lambda[j] <= 0;
                         lambda[j] <= 0
eq[6] := mu[i]*g[i] = 0;
                       -mu[13] x[13] = 0
eval(solve({eq[1], eq[2], eq[3], eq[4], eq[5], eq[6]}, [vars, lambda[j], mu[i]]));
Error, invalid input: too many and/or wrong type of arguments passed to solve; first unused argument is [[x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]], lambda[j], mu[13]]
 

Hi,

I'm trying to change with a Maple Worksheet the parameters of a MapleSim Model in Real-matrices format.

is there any way to do that?

actually i get the failure note:

<<Error, (in SetParameters) non-vectorized values in vector parameters: [list= ""]>>



 

Thank You

Regards
Johann
 

I have the Ubuntu of Linux app installed in Windows 10. Could anyone help me with exactly how to install Maple2020.0LinuxX64Installer.run in the Ubuntu terminal? Many thanks.

Dear maple users,

Greetings

How to eval a function as a sequence of x(x=0..1)

f := unapply(3*x^2-2*x^3-1.080674649*x^2*(x-1)^2-.8118769171*x^2*(x-1)^3+.4147046974*x^2*(x-1)^4+.4585681954*x^2*(x-1)^5, x);
ma := seq(eval(f(x), x = 0 .. 1))

May be a question is simple, but I'm beginner in Maple and I didn't find answer in Internet. I defined two functions: f(x,y)=sin(x)*cos(y) and g(x,y)=sin(y)*cos(x). How can I calculate third function v(x,y)=f(x,y)-g(x,y)? Answer of this operation should be: v(x,y)=sin(x-y).

I am tried to solve the following problem. here is the code and boundary conditions as well as parameters used in the problem. Please help me to get the numerical solution and getting plots between Cu and eta as well as D(f)(eta) vs eta.

restart;
Digits := trunc(evalhf(Digits));
                               15
ODEs := [diff(f(eta), `$`(eta, 3))+A^2+f(eta)*(diff(f(eta), `$`(eta, 2)))-(diff(f(eta), eta))^2+beta*((diff(g(eta), eta))^2-g(eta)*(diff(g(eta), `$`(eta, 2)))-1), lambda*(diff(g(eta), `$`(eta, 3)))+(diff(g(eta), `$`(eta, 2)))*f(eta)-g(eta)*(diff(f(eta), `$`(eta, 2)))];
`<,>`(ODEs[]);
           Vector[column](%id = 18446744073898822582)
LB, UB := 0, 1;
BCs := [`~`[`=`](([D(f), f, g, (D@@2)(g)])(LB), [1+B1*((D@@2)(f))(0), 0, 0, 0])[], `~`[`=`](([D(f), D(g)])(UB), [A, 0])[]];
     [D(f)(0) = 1 + B1 @@(D, 2)(f)(0), f(0) = 0, g(0) = 0, 

       @@(D, 2)(g)(0) = 0, D(f)(1) = A, D(g)(1) = 0]
Params := Record(A = .9, B1 = .5, beta = .5, lambda = .5);
NBVs := [-((D@@2)(f))(1) = `C*__f`];
Cf := `C*__f`;
Solve := module () local nbvs_rhs, Sol, ModuleApply, AccumData, ModuleLoad; export SavedData, Pos, Init;  nbvs_rhs := `~`[rhs](:-NBVs); ModuleApply := subs(_Sys = {:-BCs[], :-NBVs[], :-ODEs[]}, proc ({ A::realcons := Params:-A, B1::realcons := Params:-B1, beta::realcons := Params:-beta, lambda::realcons := Params:-lambda }) Sol := dsolve(_Sys, _rest, numeric); AccumData(Sol, {_options}); Sol end proc); AccumData := proc (Sol::{Matrix, procedure, list({name, function} = procedure)}, params::(set(name = realcons))) local n, nbvs; if Sol::Matrix then nbvs := seq(n = Sol[2, 1][1, Pos(n)], n = nbvs_rhs) else nbvs := `~`[`=`](nbvs_rhs, eval(nbvs_rhs, Sol(:-LB)))[] end if; SavedData[params] := Record[packed](params[], nbvs) end proc; ModuleLoad := eval(Init); Init := proc () Pos := proc (n::name) local p; option remember; member(n, Sol[1, 1], 'p'); p end proc; SavedData := table(); return  end proc; ModuleLoad() end module;
colseq := [red, green, blue, brown];
Pc := B1 = .5, A = .1, beta = .5;
Ps := [B1 = .5, A = .1, beta = .5];
Pv := [lambda = [.5, 1, 1.5, 2]];
for i to nops(Ps) do plots:-display([seq(plots:-odeplot(Solve(lhs(Pv[i]) = rhs(Pv[i])[j], Ps[i][], Pc), [eta, theta(eta)], 'color' = colseq[j], 'legend' = [lhs(Pv[i]) = rhs(Pv[i])[j]]), j = 1 .. nops(rhs(Pv[i])))], 'axes' = 'boxed', 'gridlines' = false, 'labelfont' = ['TIMES', 'BOLDOBLIQUE', 16], 'caption' = nprintf(cat(`$`("\n%a = %4.2f, ", nops(Ps[i])-1), "%a = %4.2f\n\n"), `~`[lhs, rhs](Ps[i])[]), 'captionfont' = ['TIMES', 16]) end do;
Error, (in dsolve/numeric/process_input) invalid argument: (B1 = .5)[]

 

 

Please help me to get the graph of CU v/s eta also D(f)(eta) vs eta
 


 

restart

sigma[1] := 0.1e-5;

0.1e-5

 

3.0

 

1.1

 

0.1e-1

 

0.1e-5

 

4.0

 

0.1e-1

 

.12

 

.2

 

0.2e-1

(1)

"(&PartialD;)/(&PartialD; t) C(t, x)=`sigma__1`*((&DifferentialD;)^2)/((&DifferentialD;)^( )x^2) C(t, x)+alpha[1]*C(t, x)^(`k__1`)+alpha[1]*C(t, x)^(`k__2`)*B(t, x)^(`k__3`)-`beta__1`*C(t, x),  (&PartialD;)/(&PartialD; t) B(t, x)=`sigma__2`*((&DifferentialD;)^2)/((&DifferentialD;)^( )x^2) B(t, x)+alpha[2]*B(t, x)^(`k__3`)+alpha[2]*C(t, x)^(`k__2`)*B(t, x)^(`k__4`)-`beta__2`*B(t, x),    #`with boundary conditions`  (&PartialD;)/(&PartialD; x) C(t, 0)=0,(&PartialD;)/(&PartialD; x) C(t, 1)=0,  (&PartialD;)/(&PartialD; x) B(t, 0)=0,(&PartialD;)/(&PartialD; x) B(t, 1)=0,    #`and initial conditions`   C(0, x) = `C__o`(x) ,  B(0, x)=B[o](x), #`In this model C(0) = 13.0 and B(0) = 300 `    #`I need the numerical solutions of C and B`  #`variations of parameters like sigma`[1], sigma[2, ]beta[1], beta[2]  #thanks    "


 

Download pde_solve.mw

alpha:=1:dT:=Th-Tc:n:=1:

plot(subs(Tc=400,n*alpha*dT/2),Th=300..700);

All the units are in Kelvin but now I want to have Th on x-axis to be in Celsius.

Is this possible?

Thanks  
 

How I can determine the trace of the matrix.

My answer has a lot of differences comparing the result provided in the pdf file (end of the file).

Also, I think we should use from  EQ(4).

what is the problem?

Please help me..

Best

Doc2.pdf

1111.mw


 

restart; x__2 := beta*gamma+2*beta+delta*gamma+delta-alpha-sqrt(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)/(2*(beta+delta))

y__2 := 1-x__2

J := Matrix([[1-2*x__2-y__2, -x__2], [beta*y__2^2/x__2^2, delta-2*beta*y__2/x__2-alpha*gamma/(gamma+y__2)^2]])

 

 

                            

and y__2*(delta-beta*y__2/x__2)-alpha*y__2/(gamma+y__2) = 0``

Error, reserved word `and` unexpected

 
  NULL

 

 

NULL

TTR := Trace(J)

TTR := 1-2*x__2-y__2+delta-2*beta*y__2/x__2-alpha*gamma/(gamma+y__2)^2

-beta*gamma-2*beta-delta*gamma+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta)-2*beta*(1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))/(beta*gamma+2*beta+delta*gamma+delta-alpha-(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))-alpha*gamma/(gamma+1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))^2

(1)

s := diff(TTR, alpha)

1+(1/2)*(-2*beta*gamma-2*delta*gamma+2*alpha-4*beta-2*delta)/((alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)*(2*beta+2*delta))-2*beta*(1+(1/2)*(-2*beta*gamma-2*delta*gamma+2*alpha-4*beta-2*delta)/((alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)*(2*beta+2*delta)))/(beta*gamma+2*beta+delta*gamma+delta-alpha-(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))+2*beta*(1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))*(-1-(1/2)*(-2*beta*gamma-2*delta*gamma+2*alpha-4*beta-2*delta)/((alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)*(2*beta+2*delta)))/(beta*gamma+2*beta+delta*gamma+delta-alpha-(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))^2-gamma/(gamma+1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))^2+2*alpha*gamma*(1+(1/2)*(-2*beta*gamma-2*delta*gamma+2*alpha-4*beta-2*delta)/((alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)*(2*beta+2*delta)))/(gamma+1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))^3

(2)

NULL

NULL


 

Download 1111.mw

Can Maple open a Mathematica .cdf file (computable document format)?

If so, how?

First 553 554 555 556 557 558 559 Last Page 555 of 2426