MaplePrimes Questions

How do you substitute into a contravariant index of a tensor say

T[~mu, nu]     ?

Nothing seems to work, I tried to subs(~mu=~1,T[~mu, nu]), subs(mu=1,T[~mu, nu]), and all permutations.

Substituting values into the covariant index works fine but not contravariant.

Surely it must be possible ?

When executing the attached work sheet, the output

changes to

Why is that (local seetings maybe?) and how to reproduce the former, more compact output?

Copy-pasted from the wonderful:

Advanced Engineering Mathematics

Dr. Robert J. Lopez

Emeritus Professor of Mathematics

Maple Fellow

© Maplesoft, a division of Waterloo Maple Inc., 2023

This is obtained in Maple by writing the differential equation

 

q := diff(x(t),t) = k*(40 - 16/18*x(t))*(8 - 2/18*x(t));

diff(x(t), t) = k*(40-(8/9)*x(t))*(8-(1/9)*x(t))

(1)

 

and solving via the syntax

 

X := simplify(rhs(dsolve({q,x(0)=0},x(t))));

(-360+360*exp((8/3)*t*k))/(8*exp((8/3)*t*k)-5)

(2)

 

The differential equation is actually separable, and can be solved with the techniques of elementary calculus discussed in Section 3.1.

 

If an observation provides the data that at time t = 1 there were 6 grams of water, then the constant of proportionality k can be computed.  In Maple, the data point gives the equation

 

eq := eval(X, t=1) = 6;

(-360+360*exp((8/3)*k))/(8*exp((8/3)*k)-5) = 6

(3)

 

whose solution is

 

K := solve(eq,k);

(3/8)*ln(55/52)

(4)
 

 

Download Output_formated_with_rational_factor_.mw

Hi everyone...

I want to know how can I convert python code & c+ code into maple, is there any command or algorithm for these converts? 

Tnx...

restart;
with(combinat);
F := unapply(rsolve({F(1) = 1, F(2) = 1, F(n + 1) = F(n) + F(n - 1)}, F(n)), n);
combine(expand(F(n + 1)*F(n + 2) - F(n)*F(n + 3)));
F := n -> fibonacci(n);
combine(expand(F(n + 1)^2 - F(n)*F(n + 3) + (-1)^n));
is(F(n + 1)^2 = F(n)*F(n + 2) + (-1)^n);#should be true
G := n -> arctan(1/F(n));
is(G(4) = G(5) + G(6));
is(G(4) = G(5) + G(6));
is(G(2*n) = G(2*n + 1) + G(2*n + 2));#should be true
How to establish these formulas ? Thank you.

odetest should be made more robust.

Here is an example where the same exact solution and same exact IC, but when solution is just writtent in a  little different form, odetest no longer verifies it.

Do you consider this a bug? How is the user supposed to know their solution is correct or not now, since it depends on how it is written? What can a user then do to help odetest in this case verify the solution?


 

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

ode:=diff(y(x), x)*x^2 + cos(2*y(x)) = 1;
ic:=y(infinity)=10/3*Pi;
e1:=2/x+1/3*sqrt(3);
SOL1:=y(x)=arccot(e1) + Pi*3;
odetest(SOL1,[ode,ic]);

(diff(y(x), x))*x^2+cos(2*y(x)) = 1

y(infinity) = (10/3)*Pi

2/x+(1/3)*3^(1/2)

y(x) = arccot(2/x+(1/3)*3^(1/2))+3*Pi

[0, 0]

#now we rewrite the solution a little different. But same solution
e2:=simplify(e1);

(1/3)*(3^(1/2)*x+6)/x

#Now maple no longer verifies the solution

SOL2:=y(x)=arccot(e2) + Pi*3;
odetest(SOL2,[ode,ic])

y(x) = arccot((1/3)*(3^(1/2)*x+6)/x)+3*Pi

[0, -(1/6)*Pi]

 


 

Download same_solution_not_verified_june_13_2024.mw

How can I get Prof. Wilhelm Werner's  FourierSeries  package? (See also "Fourier and Other Orthogonal Function Expansions in Maple" by Dr. Robert Lopez):

How to get logarithm expression using Maple command?

For example, enter log[2](x^2-3x+5)+x^3-1-log[3](x-1)

Output [x^2-3x+5,x-1]

Thank you very much for your help.

Hallo every body 

How to add vector fields to the figure of this example of a three-dimensional differential system.

in maple 18

Porgram_of_corollary_1_in_Maple.mw

NULL

restart

X[j] := x^3*a[j, 0]+x^2*y*a[j, 1]+x^2*z*a[j, 2]+x*y^2*a[j, 3]+x*y*z*a[j, 4]+x*z^2*a[j, 5]+y^3*a[j, 6]+y^2*z*a[j, 7]+y*z^2*a[j, 8]+z^3*a[j, 9]

x^3*a[j, 0]+x^2*y*a[j, 1]+x^2*z*a[j, 2]+x*y^2*a[j, 3]+x*y*z*a[j, 4]+x*z^2*a[j, 5]+y^3*a[j, 6]+y^2*z*a[j, 7]+y*z^2*a[j, 8]+z^3*a[j, 9]

(1)

s := sum(epsilon^j*X[j], j = 0 .. 2)

x^3*a[0, 0]+x^2*y*a[0, 1]+x^2*z*a[0, 2]+x*y^2*a[0, 3]+x*y*z*a[0, 4]+x*z^2*a[0, 5]+y^3*a[0, 6]+y^2*z*a[0, 7]+y*z^2*a[0, 8]+z^3*a[0, 9]+epsilon*(x^3*a[1, 0]+x^2*y*a[1, 1]+x^2*z*a[1, 2]+x*y^2*a[1, 3]+x*y*z*a[1, 4]+x*z^2*a[1, 5]+y^3*a[1, 6]+y^2*z*a[1, 7]+y*z^2*a[1, 8]+z^3*a[1, 9])+epsilon^2*(x^3*a[2, 0]+x^2*y*a[2, 1]+x^2*z*a[2, 2]+x*y^2*a[2, 3]+x*y*z*a[2, 4]+x*z^2*a[2, 5]+y^3*a[2, 6]+y^2*z*a[2, 7]+y*z^2*a[2, 8]+z^3*a[2, 9])

(2)

s1 := subs(a = b, s)

x^3*b[0, 0]+x^2*y*b[0, 1]+x^2*z*b[0, 2]+x*y^2*b[0, 3]+x*y*z*b[0, 4]+x*z^2*b[0, 5]+y^3*b[0, 6]+y^2*z*b[0, 7]+y*z^2*b[0, 8]+z^3*b[0, 9]+epsilon*(x^3*b[1, 0]+x^2*y*b[1, 1]+x^2*z*b[1, 2]+x*y^2*b[1, 3]+x*y*z*b[1, 4]+x*z^2*b[1, 5]+y^3*b[1, 6]+y^2*z*b[1, 7]+y*z^2*b[1, 8]+z^3*b[1, 9])+epsilon^2*(x^3*b[2, 0]+x^2*y*b[2, 1]+x^2*z*b[2, 2]+x*y^2*b[2, 3]+x*y*z*b[2, 4]+x*z^2*b[2, 5]+y^3*b[2, 6]+y^2*z*b[2, 7]+y*z^2*b[2, 8]+z^3*b[2, 9])

(3)

s2 := subs(a = c, s)

x^3*c[0, 0]+x^2*y*c[0, 1]+x^2*z*c[0, 2]+x*y^2*c[0, 3]+x*y*z*c[0, 4]+x*z^2*c[0, 5]+y^3*c[0, 6]+y^2*z*c[0, 7]+y*z^2*c[0, 8]+z^3*c[0, 9]+epsilon*(x^3*c[1, 0]+x^2*y*c[1, 1]+x^2*z*c[1, 2]+x*y^2*c[1, 3]+x*y*z*c[1, 4]+x*z^2*c[1, 5]+y^3*c[1, 6]+y^2*z*c[1, 7]+y*z^2*c[1, 8]+z^3*c[1, 9])+epsilon^2*(x^3*c[2, 0]+x^2*y*c[2, 1]+x^2*z*c[2, 2]+x*y^2*c[2, 3]+x*y*z*c[2, 4]+x*z^2*c[2, 5]+y^3*c[2, 6]+y^2*z*c[2, 7]+y*z^2*c[2, 8]+z^3*c[2, 9])

(4)

Considérons le système suivant:

a[1] := 0; c[1] := 0

a[0, 9] := 0; c[0, 8] := 0; b[0, 7] := 0; a[0, 4] := 0; a[0, 7] := 0; c[0, 3] := 0; c[0, 0] := 0; c[0, 5] := 0; b[0, 4] := 0; a[0, 2] := 0; c[0, 6] := 0; c[0, 1] := 0; c[0, 7] := 0; a[0, 8] := 0; b[0, 5] := 0

b0 := 5; a[4] := 0; c[4] := 0; c[2, 9] := 0; c[2, 2] := 0; c[2, 7] := 0; a[2, 5] := 0; b[2, 8] := 0; a[2, 0] := 0; b[2, 6] := 0; b[2, 1] := 0; a[2, 3] := 0; b[0, 9] := 0

b[1] := 0; b[2] := 0; b[3] := 0; b[4] := 0; a[1, 2] := 0; a[1, 1] := 0; a[1, 4] := 0; a[1, 6] := 0; a[1, 7] := 0; a[1, 8] := 0; a[1, 9] := 0; a[2, 9] := 0; a[2, 8] := 0; a[2, 7] := 0; a[2, 6] := 0; a[2, 4] := 0; a[2, 2] := 0; a[2, 1] := 0; b[1, 0] := 0; b[1, 2] := 0; b[1, 3] := 0; b[1, 4] := 0; b[1, 5] := 0; b[1, 7] := 0; b[1, 9] := 0; b[2, 0] := 0; b[2, 2] := 0; b[2, 3] := 0; b[2, 4] := 0; b[2, 5] := 0; b[2, 7] := 0; b[2, 9] := 0; c[1, 0] := 0; c[1, 1] := 0; c[1, 3] := 0; c[1, 4] := 0; c[1, 5] := 0; c[1, 6] := 0; c[1, 8] := 0; c[2, 0] := 0; c[2, 1] := 0; c[2, 3] := 0; c[2, 4] := 0; c[2, 5] := 0; c[2, 6] := 0; c[2, 8] := 0; b[0, 2] := 0; c[1, 7] := 0

a[1, 0] := 0; a[1, 3] := 0; a[1, 5] := 0; b[1, 1] := 0; b[1, 6] := 0; b[1, 8] := 0; c[1, 2] := 0; c[1, 9] := 0; a[3] := 0; c[3] := 0; a[2] := 1/2; c[2] := 3/2; a[0, 0] := -1/2; a[0, 3] := 5/4; a[0, 1] := 0; a[0, 5] := 0; a[0, 6] := 0; b[0, 6] := -1; b[0, 1] := 3/2; b[0, 0] := 0; b[0, 3] := 0; b[0, 8] := 0; c[0, 2] := 0; c[0, 4] := 0; c[0, 9] := -1/3

eq1 := (epsilon^4*a[4]+epsilon^3*a[3]+epsilon^2*a[2]+epsilon*a[1])*x-(epsilon^4*b[4]+epsilon^3*b[3]+epsilon^2*b[2]+epsilon*b[1]+b0)*y+s

(1/2)*epsilon^2*x-5*y-(1/2)*x^3+(5/4)*x*y^2

(5)

eq2 := (epsilon^4*b[4]+epsilon^3*b[3]+epsilon^2*b[2]+epsilon*b[1]+b0)*x+(epsilon^4*a[4]+epsilon^3*a[3]+epsilon^2*a[2]+epsilon*a[1])*y+s1

5*x+(1/2)*epsilon^2*y+(3/2)*x^2*y-y^3

(6)

eq3 := (epsilon^4*c[4]+epsilon^3*c[3]+epsilon^2*c[2]+epsilon*c[1])*z+s2

(3/2)*epsilon^2*z-(1/3)*z^3

(7)

Faisons le changement (x,y,z)=(εX,εY,εZ)

 

x := epsilon*X; y := epsilon*Y; z := epsilon*Z

epsilon*X

 

epsilon*Y

 

epsilon*Z

(8)

Xpoint := collect(eq1/epsilon, epsilon)

((1/2)*X-(1/2)*X^3+(5/4)*X*Y^2)*epsilon^2-5*Y

(9)

Ypoint := collect(eq2/epsilon, epsilon)

((1/2)*Y+(3/2)*X^2*Y-Y^3)*epsilon^2+5*X

(10)

Zpoint := collect(eq3/epsilon, epsilon)

((3/2)*Z-(1/3)*Z^3)*epsilon^2

(11)

Faisons le changement (X, Y, Z) = (`ϱ`*cos(theta), `ϱ`*sin(theta), eta)

 

X := `ϱ`*cos(theta); Y := `ϱ`*sin(theta); Z := eta

`ϱ`*cos(theta)

 

`ϱ`*sin(theta)

 

eta

(12)

`ϱt` := collect(simplify((X*Xpoint+Y*Ypoint)/`ϱ`), epsilon)

-(1/4)*`ϱ`*epsilon^2*(17*`ϱ`^2*cos(theta)^4-19*cos(theta)^2*`ϱ`^2+4*`ϱ`^2-2)

(13)

`θt` := collect(simplify((X*Ypoint-Xpoint*Y)/`ϱ`^2), epsilon)

5+((17/4)*`ϱ`^2*cos(theta)^3*sin(theta)-(9/4)*`ϱ`^2*sin(theta)*cos(theta))*epsilon^2

(14)

`ηt` := collect(Zpoint, epsilon)

((3/2)*eta-(1/3)*eta^3)*epsilon^2

(15)

Utilisons le développpement de taylor

p := series(`ϱt`/`θt`, epsilon, 5)

series(-((1/20)*`ϱ`*(17*`ϱ`^2*cos(theta)^4-19*cos(theta)^2*`ϱ`^2+4*`ϱ`^2-2))*epsilon^2+((1/100)*`ϱ`*(17*`ϱ`^2*cos(theta)^4-19*cos(theta)^2*`ϱ`^2+4*`ϱ`^2-2)*((17/4)*`ϱ`^2*cos(theta)^3*sin(theta)-(9/4)*`ϱ`^2*sin(theta)*cos(theta)))*epsilon^4+O(epsilon^6),epsilon,6)

(16)

q := series(`ηt`/`θt`, epsilon, 5)

series(((3/10)*eta-(1/15)*eta^3)*epsilon^2+((1/5)*(-(3/10)*eta+(1/15)*eta^3)*((17/4)*`ϱ`^2*cos(theta)^3*sin(theta)-(9/4)*`ϱ`^2*sin(theta)*cos(theta)))*epsilon^4+O(epsilon^6),epsilon,6)

(17)

NULL

Averaging d'ordre 1

Les fonctions F11 et F21 sont données comme suit:

NULL

F11 := coeff(p, epsilon)

0

(18)

F21 := coeff(q, epsilon)

0

(19)

NULL

Calculons les fonctions moyennées f11et f12

f11 := (int(F11, theta = 0 .. 2*Pi))/(2*Pi)

0

(20)

f12 := (int(F21, theta = 0 .. 2*Pi))/(2*Pi)

0

(21)

solve({f11 = 0, f12 = 0}, {eta, `ϱ`})

{eta = eta, `ϱ` = `ϱ`}

(22)

NULL

Averaging d'ordre 2

NULL

F12 := simplify(coeff(p, epsilon^2))

-(1/20)*`ϱ`*(17*`ϱ`^2*cos(theta)^4-19*cos(theta)^2*`ϱ`^2+4*`ϱ`^2-2)

(23)

F22 := simplify(coeff(q, epsilon^2))

(3/10)*eta-(1/15)*eta^3

(24)

NULL

Calculons les fonctions moyennées "f21 "et "f22"

f21 := simplify((int(F12, theta = 0 .. 2*Pi))/(2*Pi))

-(1/160)*`ϱ`*(7*`ϱ`^2-16)

(25)

f22 := simplify((int(F22, theta = 0 .. 2*Pi))/(2*Pi))

-(1/30)*eta*(2*eta^2-9)

(26)

solve({f21 = 0, f22 = 0}, {eta, `ϱ`})

{eta = 0, `ϱ` = 0}, {eta = 3*RootOf(2*_Z^2-1), `ϱ` = 0}, {eta = 0, `ϱ` = 4*RootOf(7*_Z^2-1)}, {eta = 3*RootOf(2*_Z^2-1), `ϱ` = 4*RootOf(7*_Z^2-1)}

(27)

allvalues({eta = 0, `ϱ` = 4*RootOf(7*_Z^2-1)})

{eta = 0, `ϱ` = (4/7)*7^(1/2)}, {eta = 0, `ϱ` = -(4/7)*7^(1/2)}

(28)

allvalues({eta = 3*RootOf(2*_Z^2-1), `ϱ` = 4*RootOf(7*_Z^2-1)})

{eta = (3/2)*2^(1/2), `ϱ` = (4/7)*7^(1/2)}, {eta = -(3/2)*2^(1/2), `ϱ` = (4/7)*7^(1/2)}, {eta = (3/2)*2^(1/2), `ϱ` = -(4/7)*7^(1/2)}, {eta = -(3/2)*2^(1/2), `ϱ` = -(4/7)*7^(1/2)}

(29)

NULL

with(VectorCalculus)

M, d := Jacobian([f21, f22], [`ϱ`, eta] = [(4/7)*sqrt(7), 0], 'determinant')

Matrix(%id = 18446744074358842782), -3/50

(30)

factor(d)

-3/50

(31)

M1, d1 := Jacobian([f21, f22], [`ϱ`, eta] = [(4/7)*sqrt(7), (3/2)*sqrt(2)], 'determinant')

Matrix(%id = 18446744074358843142), 3/25

(32)

d1 := factor(d1)

3/25

(33)

M2, d2 := Jacobian([f21, f22], [`ϱ`, eta] = [(4/7)*sqrt(7), -(3/2)*sqrt(2)], 'determinant')

Matrix(%id = 18446744074358843382), 3/25

(34)

factor(d2)

3/25

(35)

restart

with(DEtools):

epsilon := 10^(-2)

1/100

(36)

eq1 := diff(x(t), t) = (1/2)*epsilon^2*x(t)-5*y(t)-(1/2)*x(t)^3+(5/4)*x(t)*y(t)^2

diff(x(t), t) = (1/20000)*x(t)-5*y(t)-(1/2)*x(t)^3+(5/4)*x(t)*y(t)^2

(37)

eq2 := diff(y(t), t) = 5*x(t)+(1/2)*epsilon^2*y(t)+(3/2)*x(t)^2*y(t)-y(t)^3

diff(y(t), t) = 5*x(t)+(1/20000)*y(t)+(3/2)*x(t)^2*y(t)-y(t)^3

(38)

eq3 := diff(z(t), t) = (3/2)*epsilon^2*z(t)-(1/3)*z(t)^3

diff(z(t), t) = (3/20000)*z(t)-(1/3)*z(t)^3

(39)

DEplot3d([eq1, eq2, eq3], [x(t), y(t), z(t)], t = -10 .. 10, [[x(0) = 0.1511857892e-1, y(0) = 0, z(0) = 0], [x(0) = 0.1511857892e-1, y(0) = 0, z(0) = 0.2121320343e-1], [x(0) = 0.1511857892e-1, y(0) = 0, z(0) = -0.2121320343e-1]], linecolor = [blue, red, black], stepsize = 0.1e-1)

 

Download Porgram_of_corollary_1_in_Maple.mw

Hi,

I am trying to produce two statistical tables representing a weighted series in a horizontal manner (Tab1) and in a vertical manner (Tab0). The xi and ni in Tab1 do not display well... Perhaps, there is a simpler way to do this?S5S4BoxPlotPondération.mw

Hello, 

do you have an idea how could be filtered several values from dataframe? 
I have a dataframe called "TestData". I need to select rows from data frame which are equal to the list called "SelectionList". 

Thank you for a comment. 
 

Data:=<"LC1", "LC2", "LC3", "LC4", "LC5", "LC6", "LC7", "LC8", "LC9", "LC10", "LC11", "LC12", "LC13", "LC14", "LC15", "LC16", "LC17", "LC18", "LC19", "LC20">;
LoadValue2:=<10,15,100,82,18,89,25,84,46,18,79,12,0,28,147,15,86,444,18,65>;

TestData:=DataFrame(<Data|LoadValue2>,columns=[Case,Load]);

SelectionList:={"LC3", "LC4", "LC5", "LC6", "LC7", "LC8", "LC9"};

I want to place a grid on this drawing 16x7=112 small squares. Thank you.
with(plots);
with(geometry);
_EnvHorizontalName := 'x';
_EnvVerticalName := 'y';
unprotect(D);
point(A, 0, 0);
point(B, 8, 0);
point(C, 8, 1);
point(D, 16, 2);
point(E, 15, 5);
line(AD, [A, D]);
line(AE, [A, E]);
line(DE, [D, E]);
line(AB, [A, B]);
segment(s1, B, C);
segment(s2, B, A);
triangle(Tr, [A, D, E]);
alpha := FindAngle(AB, AD);
beta := FindAngle(AD, AE);
is(alpha + beta = arctan(1/3));
pl := plot(gridlines = true, title = "Dessin pour montrer que arctan(1/3)=arctan(1/5)+arctan(1/8)", titlefont = ["ROMAN", 20]);
display(textplot([[coordinates(A)[], "A"], [coordinates(B)[], "B"], [coordinates(C)[], "C"], [coordinates(D)[], "D"], [coordinates(E)[], "E"]], align = {"above", 'right'}), draw([A(color = black, symbol = solidcircle, symbolsize = 16), D(color = black, symbol = solidcircle, symbolsize = 16), E(color = black, symbol = solidcircle, symbolsize = 16), s1(color = blue), s2(color = blue), Tr(color = orange, filled = true, transparency = 0.9), Tr(color = blue)]), pl, gridlines = true, axes = none);

Dears, 

Can you look the code bellow and send me my error please? I used Maple 18.

restart;
with(plots);
theta(t) = 19.592+1.2697*cos(.5240*t+4.3391)-.6343*cos((2*.5240)*t-.6963);
omicron(t) = 99.4876+89.8581*cos(.5232*t+15.4500)+19.1069*sin((2*.5232)*t)-8.5891*cos((3*.5232)*t+3.7723)+6.4660*sin((5*.5232)*t);
`&varphi;`(theta):=0.000203*theta*(theta - 11.7)*sqrt(42.3-theta);
mu[v](theta,omicron):=0.0886*exp(((0.01*omicron +1.01*theta  -21.211)/(14.852))^(4));
p[0](theta):=(-0.153* theta*theta + 8.61*theta - 97)/(mu[v](theta,omicron)):
p[2](omicron):=(4*0.25)/(2500)*omicron*( 50 -omicron);
p[3](omicron):=(4*0.75)/(2500)*omicron*( 50 -omicron);
p[2](theta):=exp (0.06737 - 0.00554*theta);
theta[EA](theta):=1/(-0.00094*theta*theta + 0.049*theta - 0.552);
L[v](theta,omicron):=(3.375*(4*omicron*(50-omicron))^(3)*exp(0.0054*theta+0.6737))/(50^(6)*(2+(0.00554*theta-0.06737)^(-1)));
eta(theta,omicron):=(p[0](theta)*p[1](omicron)*p[2](omicron)*p[3](omicron)*p[2](theta))/(theta[EA](theta));
lambda[v] := beta[v]*`&varphi;`(theta)*i[v](t)/n[h](t);
lambda[h] := (beta[h]*`&varphi;`(theta)*i[h](t)+beta[h]*`&varphi;`(theta)*omega*r[h](t))/n[h](t);
n[v](t):=s[v](t)+i[v](t);
beta[h] := 0.9e-1; beta[v] := 0.2e-1; Lambda[h] := .50; sigma[1] := 0.15e-1; sigma[2] := 0.71e-1; Omega[h] := .50; mu[h] := 0.128e-1; delta[h] := .45; k[v] := .66; omega := .3; mu[d] := 0.14e-2;
sys := {diff(i[h](t), t) = Omega[h]+sigma[2]*r[h](t)+lambda[v]*s[h](t)-(delta[h]+mu[d]+mu[h])*i[h](t), diff(i[v](t), t) = lambda[h]*s[v](t)-mu[v](theta, omicron)*i[v](t), diff(j[v](t), t) = L[v](theta, omicron)*(1-j[v](t)/k[v])*n[v](t)-(eta(theta, omicron)+mu[j](theta, omicron))*j[v](t), diff(r[h](t), t) = delta[h]*i[h](t)-(sigma[1]+sigma[2]+mu[h])*r[h](t), diff(s[h](t), t) = Lambda[h]+sigma[1]*r[h](t)-(lambda[v]+mu[h])*s[h](t), diff(s[v](t), t) = eta(theta, omicron)*j[v](t)-(lambda[h]+mu[v](theta, omicron))*s[v](t), i[h](0) = 100, i[v](0) = 100, j[v](0) = 200, r[h](0) = 0, s[h](0) = 10000, s[v](0) = 5000};
p1 := dsolve(sys, numeric, method = rkf45, output = procedurelist);
Error, (in dsolve/numeric/process_input) input system must be an ODE system, found {mu[j](theta, omicron), mu[v](theta, omicron)}
p1o := odeplot(p1, [theta, omicron, i[h](t)], 0 .. 10, numpoints = 100, labels = ["Time (Days)", " infectious population"], labeldirections = [horizontal, vertical], style = line, color = red, axes = boxed, legend = [front, rear, ideal]);

Maple gives same solution for two different equations.

eq1 := 1/5*sqrt(-20*y + 1) - 1/5*ln(1 + sqrt(-20*y + 1)) = x + 2;
eq2 := -1/5*sqrt(-20*y + 1) - 1/5*ln(1 - sqrt(-20*y + 1)) = x + 2;

Solving these for y, gives same exact solution. But this is not correct. As this worksheet shows.

Is this a bug? How could two different equations give same solution?
 

15172

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Case 1. Solve first then plugin x value in solution

 

eq1:=(sqrt(a^2 - 4*b*y) - a*ln(a + sqrt(a^2 - 4*b*y)))/b=x+c__1;
eq2:=(-sqrt(a^2 - 4*b*y) - a*ln(a - sqrt(a^2 - 4*b*y)))/b=x+c__1;

eq1:=eval(eq1,[a=1,b=5,c__1=2]);
eq2:=eval(eq2,[a=1,b=5,c__1=2]);

((a^2-4*b*y)^(1/2)-a*ln(a+(a^2-4*b*y)^(1/2)))/b = x+c__1

(-(a^2-4*b*y)^(1/2)-a*ln(a-(a^2-4*b*y)^(1/2)))/b = x+c__1

(1/5)*(-20*y+1)^(1/2)-(1/5)*ln(1+(-20*y+1)^(1/2)) = x+2

-(1/5)*(-20*y+1)^(1/2)-(1/5)*ln(1-(-20*y+1)^(1/2)) = x+2

sol1:=simplify(solve(eq1,y));

-(1/20)*LambertW(-exp(-11-5*x))*(LambertW(-exp(-11-5*x))+2)

sol2:=simplify(solve(eq2,y));

-(1/20)*LambertW(-exp(-11-5*x))*(LambertW(-exp(-11-5*x))+2)

eval(sol1,x=10.);

0.3221340286e-27

eval(sol2,x=10.);

0.3221340286e-27

Case 2. Plugin in same x value in equation and then solve, we get different answers

 

eq1:=(sqrt(a^2 - 4*b*y) - a*ln(a + sqrt(a^2 - 4*b*y)))/b=x+c__1;
eq2:=(-sqrt(a^2 - 4*b*y) - a*ln(a - sqrt(a^2 - 4*b*y)))/b=x+c__1;

eq1:=eval(eq1,[a=1,b=5,c__1=2,x=10]);
eq2:=eval(eq2,[a=1,b=5,c__1=2,x=10]);

((a^2-4*b*y)^(1/2)-a*ln(a+(a^2-4*b*y)^(1/2)))/b = x+c__1

(-(a^2-4*b*y)^(1/2)-a*ln(a-(a^2-4*b*y)^(1/2)))/b = x+c__1

(1/5)*(-20*y+1)^(1/2)-(1/5)*ln(1+(-20*y+1)^(1/2)) = 12

-(1/5)*(-20*y+1)^(1/2)-(1/5)*ln(1-(-20*y+1)^(1/2)) = 12

sol1:=evalf(solve(eq1,y));

-205.8850616

sol2:=evalf(solve(eq2,y));

0.3221340286e-27


 

Download different_equations_give_same_solution_june_12_2024.mw

 

On the corresponding Modelica page I find

Since MapleSim 2024 now has been upgraded to Modelica 4.0 (which I appreciate very much by the way - Thank you), I was wondering if I could give this libraray a try?

I am looking for simple ways to set up digital controllers in the context of developement of code for micro-controllers. From the github page:

Furthermore, in sublibrary Controller about 20 input/output blocks of linear systems are provided that are based on the different representation forms, e.g., PID, StateSpace, Filter blocks. A unique feature of these blocks is that it is very convenient to quickly switch between a continuous and a discrete block representation. Also, templates are provide to quickly built-up standard controller structures. 

I am using intersectplot  to make projective coordinate plots. Everything intersects the plane z=1. I find the plot quality poor, i.e. dotty dashy lines and circle. This seem to be the best linestyle=solid can do here. gridrefine can't be applied here. 
Any suggestions to improve quality here?
Maybe intersectplot is not the best aprroach here but so far it is all if have figured out.


restart

 

 

with(plottools)

[annulus, arc, arrow, circle, colorbar, cone, cuboid, curve, cutin, cutout, cylinder, disk, dodecahedron, ellipse, ellipticArc, exportplot, extrude, getdata, hemisphere, hexahedron, homothety, hyperbola, icosahedron, importplot, line, octahedron, parallelepiped, pieslice, point, polygon, polygonbyname, prism, project, pyramid, rectangle, reflect, rotate, scale, sector, semitorus, sphere, stellate, tetrahedron, torus, transform, translate, triangulate]

(1)

with(plots)

[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]

(2)

 

 

DistCircle:=x^2+y^2=1

x^2+y^2 = 1

(3)

pt1:=[1/4,3/4]

[1/4, 3/4]

(4)

pt2:=[7/8,-1/3]

[7/8, -1/3]

(5)

pt3:=[-3/2,3/7]

[-3/2, 3/7]

(6)

pt4:=[3/5,-4/5]

[3/5, -4/5]

(7)

pt5:=[-1/10,-3/2]

[-1/10, -3/2]

(8)

 

L12:=-(13*x)/12 - (5*y)/8 + 71/96; #LnPeqns(pt1,pt2);

-(13/12)*x-(5/8)*y+71/96

(9)

L13:=-(9*x)/28 + (7*y)/4 - 69/56; #LnPeqns(pt1,pt3);

-(9/28)*x+(7/4)*y-69/56

(10)

L23:=(16*x)/21 + (19*y)/8 + 1/8; #LnPeqns(pt2,pt3);

(16/21)*x+(19/8)*y+1/8

(11)

L35:=(27*x)/14 + (7*y)/5 + 321/140; #LnPeqns(pt5,pt3)

(27/14)*x+(7/5)*y+321/140

(12)

nullline:=3/5*x-4/5*y-1

(3/5)*x-(4/5)*y-1

(13)

ptplt:=point([pt1,pt2,pt3,pt4,pt5],color="Green",symbol=solidcircle,symbolsize=10):
txtplt:=textplot([pt4[],typeset("pt4")],align={below,right}):

plt1:=display(txtplt,implicitplot([DistCircle,L12,L13,L23,L35,nullline],x=-2..2,y=-1.5...1.5,color=[red,blue,blue,blue,blue,cyan]),ptplt,scaling=constrained)

 

 

# Projective Geometry Version

DistCirclez:=x^2+y^2-z^2;  #a Cone

 

x^2+y^2-z^2

(14)

pt1p:=[pt1[],1];
pt2p:=[pt2[],1];
pt3p:=[pt3[],1];
pt4p:=[pt4[],1];
pt5p:=[pt5[],1];

[1/4, 3/4, 1]

 

[7/8, -1/3, 1]

 

[-3/2, 3/7, 1]

 

[3/5, -4/5, 1]

 

[-1/10, -3/2, 1]

(15)

 

 

 

L12p:=(13*x)/12 + (5*y)/8 - (71*z)/96;#LnPeqns([pt1p,pt2p,[0,0,0]]);

(13/12)*x+(5/8)*y-(71/96)*z

(16)

L13p:=(13*x)/12 + (5*y)/8 - (71*z)/96;#LnPeqns([pt1p,pt3p,[0,0,0]]);

(13/12)*x+(5/8)*y-(71/96)*z

(17)

L23p:=(9*x)/28 - (7*y)/4 + (69*z)/56;#LnPeqns([pt2p,pt3p,[0,0,0]]);

(9/28)*x-(7/4)*y+(69/56)*z

(18)

L35p:=(27*x)/14 + (7*y)/5 + (321*z)/140;#LnPeqns([pt3p,pt5p,[0,0,0]]);

(27/14)*x+(7/5)*y+(321/140)*z

(19)

L04p:=3/5*x-4/5*y-1*z;

(3/5)*x-(4/5)*y-z

(20)

ptpltp:=point([pt1p,pt2p,pt3p,pt4p,pt5p],symbol=solidsphere, symbolsize=8,color="green"):
intp1:=intersectplot(DistCirclez,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,linestyle=solid):#unit circle at z=1
intp12p:=intersectplot(L12p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=blue):
intp13p:=intersectplot(L13p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=blue):
intp23p:=intersectplot(L23p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=blue):
intp35p:=intersectplot(L35p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=blue):
intp04p:=intersectplot(L04p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=cyan):

 

display(ptpltp,intp1,intp12p,intp13p,intp23p,intp35p,intp04p,scaling=constrained,caption="Projective Co-ords on plane z=1",axes=normal,axis[3]=[tickmarks=[1]])

 

 


Download 2024-06-10_Q_Intersectplot_quality.mw

First 97 98 99 100 101 102 103 Last Page 99 of 2426