Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

If you are interested in calculating the area enclosed by one loop of your data set, then do the following which is a consequence of Green's Theorem in multivariable calculus.

Let (xi,yi), i=1,2,…,n be the coordinates of the points that form one loop of your graph.  Then the enclosed area. A, is obtained from

2A = (x1y2 − x2y1) + (x2y3 − x3y2) + … + (xn-1yn − xnyn-1) + (xny1 − x1yn).

 

Change the line

diff(Q(x, t), t $ 5) = solve(ni, diff(Q(x, t), t $ 5))

to

eq := diff(Q(x, t), t $ 5) = solve(ni, diff(Q(x, t), t $ 5));

Then where you do

r := subs(diff(Q(x,t), t $5), k);

do this instead:

r := subs(eq, k);   # I think this is what you meant to do

The error goes away.  Then you are on your own for what to do with the result.

Your system of equations involves the second derivative of psi, so you need two conditions on psi, as you have prescribed.  Your system also involves the first derivatives of x and y, so you may specify x(0) and y(0), and that will yield a unique solution of the system.  You cannot arbitrarily specify extra conditions at x(1) and y(1) since in general they will conflict with the system's unique solution.

Aside: You didn't say that, but I suspect that you want to take the parameters t, r, d as unknowns which are to be determined along with the solution of the system. If that's the case, then there is a chance that a numerical solution may be found, however three parameters are too many.  You would want only two of the parameters t, r, d as unknowns, and the third one specified with a numerical value.

 

restart;
with(plots):
a := (k,p) -> (100-p)*exp(-k/2):
pvals := [0, 50, 100, 150, 200]:
colors := [blue, red, green, magenta, cyan]:
display(seq(pointplot([seq([k,a(k,p)], k=0..10)]), p in pvals),
    symbol=solidcircle, symbolsize=15, color=colors, legend=pvals);

 

I have no idea what you mean by a "composite function".

There is nothing like that in your equation.

 

As to your equation, you can solve it by hand.  You don't need Maple for it.

Begin with observing that ("abs(W)())^(2)" is the same as W^2.  So in your equation

test := abs(diff(u(x, t), x)+diff(u(x, t), t))^2 = abs(diff(u(x, t), x))^2+abs(diff(u(x, t), t))^2

abs(diff(u(x, t), x)+diff(u(x, t), t))^2 = abs(diff(u(x, t), x))^2+abs(diff(u(x, t), t))^2

drop the absolute values and get:

test := (diff(u(x, t), x)+diff(u(x, t), t))^2 = (diff(u(x, t), x))^2+(diff(u(x, t), t))^2

(diff(u(x, t), x)+diff(u(x, t), t))^2 = (diff(u(x, t), x))^2+(diff(u(x, t), t))^2

Expand the left-hand side and cancel the common terms.  Your equation reduces to

test := 2*(diff(u(x, t), x))*(diff(u(x, t), t)) = 0

2*(diff(u(x, t), x))*(diff(u(x, t), t)) = 0

We conclude that the solution of your PDE is either u(x, t) = f(x) or "u(x,t)=g(t),"
where f and g can be anything.

Download Partial_Differential_Equations_of_Composite_Functions-with-solution.mw

Your question makes sence if x is the entire real line, and the solution and its derivatives vanish at infinity.  We cannot have real infinities in a numerical calculation, so here I am take a largish x interval and impose the vanishing conditions at the interval's endpoints.

restart;

pde := diff(u(x,t),t) + diff(u(x,t),x$3) = 0;

diff(u(x, t), t)+diff(diff(diff(u(x, t), x), x), x) = 0

ibc := u(x,0)=f(x), u(a,t)=f(a), u(b,t)=f(b), D[1](u)(b,t)=D(f)(b);

u(x, 0) = f(x), u(a, t) = f(a), u(b, t) = f(b), (D[1](u))(b, t) = (D(f))(b)

a, b := -30, 10;

-30, 10

f := x -> 2/cosh(x)^2;

proc (x) options operator, arrow; 2/cosh(x)^2 end proc

pdsol := pdsolve(pde,{ibc}, numeric, spacestep=1e-2);

_m140290941899936

pdsol:-animate(t=0..1, frames=30);

Download mw.mw

What you have given as the "expected result" is not correct. Here is what you should get:

restart;

with(LinearAlgebra):

doit := proc(A::Matrix)
        local Q, R;
        Q, R := QRDecomposition(A, fullspan);
        return R . Q;
end proc:

A[0] := Matrix(  [[3.0, 1.0, 4.0], [1.0, 2.0, 2.0], [0., 13.0, 2]] );

Matrix(3, 3, {(1, 1) = 3.0000000000, (1, 2) = 1.0000000000, (1, 3) = 4.0000000000, (2, 1) = 1.0000000000, (2, 2) = 2.0000000000, (2, 3) = 2.0000000000, (3, 1) = 0., (3, 2) = 13.0000000000, (3, 3) = 2})

for i from 1 to 6 do
        A[i] := doit(A[i-1]);
end do;

Matrix(3, 3, {(1, 1) = 3.5000000000, (1, 2) = 4.4551702856, (1, 3) = -0.38180177416e-1, (2, 1) = 4.1412558482, (2, 2) = 3.5466472303, (2, 3) = 12.0839572279, (3, 1) = 0., (3, 2) = .38352988531, (3, 3) = -0.46647230321e-1})

Matrix(3, 3, {(1, 1) = 7.7653061224, (1, 2) = -3.5051266356, (1, 3) = -8.5280146144, (2, 1) = -.89936886875, (2, 2) = -3.1345831016, (2, 3) = -6.7655727021, (3, 1) = 0., (3, 2) = .81618126365, (3, 3) = 2.3692769792})

Matrix(3, 3, {(1, 1) = 8.1244016476, (1, 2) = -.40507893145, (1, 3) = 7.9914478264, (2, 1) = .41538662602, (2, 2) = -1.6766201724, (2, 3) = 8.6407060706, (3, 1) = 0., (3, 2) = .12815076053, (3, 3) = .55221852481})

Matrix(3, 3, {(1, 1) = 8.0993732348, (1, 2) = -1.5529006707, (1, 3) = -8.3271445271, (2, 1) = -0.84696189481e-1, (2, 2) = -2.2815760830, (2, 3) = -8.0017846681, (3, 1) = 0., (3, 2) = 0.91610146538e-1, (3, 3) = 1.1822028481})

Matrix(3, 3, {(1, 1) = 8.1153608751, (1, 2) = -1.1146392649, (1, 3) = 8.2940086384, (2, 1) = 0.24045008835e-1, (2, 2) = -1.9737094365, (2, 3) = 8.2142484334, (3, 1) = 0., (3, 2) = 0.34222832520e-1, (3, 3) = .85834856143})

Matrix(%id = 36893628848063747244)

Approximate eigenvalues

sort(Diagonal(A[i-1]));

Vector(3, {(1) = -2.1123294319, (2) = 1.0002884200, (3) = 8.1120410119})

Precise eigenvalues

Eigenvalues(A[0]);

Vector(3, {(1) = -2.0669460973+0.*I, (2) = .95415900373+0.*I, (3) = 8.1127870936+0.*I})

Download mw.mw

plot([seq(x+k, k=1..1.5, 0.1)], x=0..1, view=0..3);

 

dsol := dsolve({sys, ics}, numeric);
plots:-odeplot(dsol, [[t,x(t)],[t,y(t)],[t,z(t)]],
    t=0..0.005, color=[red,green,blue]);

restart;

 

Variables

 

A := 3;

3

B := 4;

4

 

 

Process 1

 

process1 := proc(x)
  return x^2*(A + B);
end proc:

 

Process 2

 

process2 := proc(x)
  return x^2*(A - B);
end proc:

 

 

Main

 

if A > B then
  process1(10);
else
  process2(12);
end if;

-144

 

Download mw.mw

 

Here is the translation into Maple of your hand-written solution.

restart;

System of equations (1)

eq1 := x__a = 1 + 2*t__1;
eq2 := y__a = t__1;
eq3 := z__a = -3 - 2*t__1;

x__a = 1+2*t__1

y__a = t__1

z__a = -3-2*t__1

System of equations (2)

eq4 := x__b = 1 - t__2;
eq5 := y__b = t__2;
eq6 := z__b = 3 + 2*t__2;

x__b = 1-t__2

y__b = t__2

z__b = 3+2*t__2

System of equations (3)

eq7 := x__a - 1 = K*(x__b - 1);
eq8 := y__a + 2 = K*(y__b + 2);
eq9 := z__a - 3 = K*(z__b - 3);

x__a-1 = K*(x__b-1)

y__a+2 = K*(y__b+2)

z__a-3 = K*(z__b-3)

Solve nine equations for nine unknowns

sol := solve({eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9}, {K, t__1, t__2, x__a, x__b, y__a, y__b, z__a, z__b});

{K = 11/2, t__1 = 3, t__2 = -12/11, x__a = 7, x__b = 23/11, y__a = 3, y__b = -12/11, z__a = -9, z__b = 9/11}

 

Download mw.mw

Your command

% sh ./Maple2021.2LinuxX64Installer.run

attempts to execute a shell script but Maple2021*.run is not a shell script; it is an executable binary. So drop the "sh" and do

% chmod +x Maple2021.2LinuxX64Installer.run
% ./Maple2021.2LinuxX64Installer.run

Here is a solution along the lines of the construction that you described in response to my question. There are more sophisticated ways of doing this. This answer intentionally uses a bare minimum of Maple in order to avoid overwhelming you.

restart;

with(plots):

with(plottools):

Define the coordinates of the vertices A and B.  Maple is happier working

with fractions rather than decimal point representations, so we write

17/2 instead of 8.5.

A, B := [ 0, 0 ], [ 17/2, 0 ];

[0, 0], [17/2, 0]

Draw the circles that you have described

display(
        line(A,B, color=red, thickness=5),
        circle(A, 5),
        circle(B, 4),
scaling=constrained);

Vertex C is where the circles intersect. There of two intersections,
so you get two choices for C.

 

To determine C's coordinates, we write down the equations of the

two circles, and solve them as simultaneous equations.

Circle1 := x^2 + y^2 = 5^2;  # circle centered at A
Circle2 := (x - 17/2)^2 + y^2 = 4^2;  # circle centered at B

x^2+y^2 = 25

(x-17/2)^2+y^2 = 16

Here are the two intersection points

sols := solve({Circle1, Circle2}, explicit);

{x = 325/68, y = (5/68)*399^(1/2)}, {x = 325/68, y = -(5/68)*399^(1/2)}

Pick the first one for C

C := subs(sols[1], [x,y]);

[325/68, (5/68)*399^(1/2)]

Time to plot the triangle

display(polygon([A,B,C]),
        color="Red", thickness=5, scaling=constrained, axes=normal);

 

Download mw.mw

 

Not an equation, but a numeric procedure.

my_x := proc(t)
        if not type(t, realcons) then return 'procname'(args); end if; 
        subs(y=t, f - 0.001 = g);
        fsolve(%, x = 0 .. 1);
end proc;
plot(my_x(y), y = 0 .. 2, view = 0 .. 1, labels = [y, x]);

The equation may be solved for y and therefore the graph may be plotted through plot() rather than implicitplot(). The following produces the plot shown in Kitonum's answer.

x^2+(y-x^(2/3))^2 = 1;
solve(%, y);
subs(x^(2/3)=surd(x^2,3), [%]);
plot(%, x=-1..1, color=red, thickness=3);

 

First 7 8 9 10 11 12 13 Last Page 9 of 53