Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

Is there a reason for looking at xhat as a function of all those variables?  Why not take xhat to be a function of a_1 only.  The solution will involve the remaining variables as parameters.

restart;

sys_ode := diff(xhat(a_1), a_1) = a_3*x + a_1, diff(yhat(a_1), a_1) = a_2 - a_4*y + f(x), diff(uhat(a_1), a_1) = a_3*u + 2*a_4*u, diff(vhat(a_1), a_1) = a_4*v + diff(f(x), x)*u;

diff(xhat(a_1), a_1) = a_3*x+a_1, diff(yhat(a_1), a_1) = a_2-a_4*y+f(x), diff(uhat(a_1), a_1) = a_3*u+2*a_4*u, diff(vhat(a_1), a_1) = a_4*v+(diff(f(x), x))*u

ics := xhat(0) = x, yhat(0) = y, uhat(0) = u, vhat(0) = v;

xhat(0) = x, yhat(0) = y, uhat(0) = u, vhat(0) = v

solution_a1 := dsolve([sys_ode, ics], [xhat(a_1), yhat(a_1), uhat(a_1), vhat(a_1)]);

{uhat(a_1) = a_1*a_3*u+2*a_1*a_4*u+u, vhat(a_1) = (diff(f(x), x))*u*a_1+a_4*v*a_1+v, xhat(a_1) = (1/2)*a_1^2+a_3*x*a_1+x, yhat(a_1) = -a_1*a_4*y+f(x)*a_1+a_1*a_2+y}

Download mw.mw

 

There is no meaningful way to do what you are asking, and that's not because of any shortcoming on the part of Maple.

Your equations are defined in a three-dimensional phase space, that is, the associated vector field is 3D and the solution curve is a curve in 3D.  You plot the projection of that 3D curve onto the (V,In) plane.  That works fine since the projection of a 3D curve onto a 2D plane is still a curve.

In contrast, the projection of a 3D vector field onto a 2D plane is not a vector field because each point of your 2D plotting domain is the foot of the projection of all the vectors in 3D that lie "above" that point.

Change
if not is({args}, set(numeric)) then return ('procname')('args') end if;
to
if not type({args}, set(numeric)) then return ('procname')('args') end if;
and it will work.

Comment added later:

It is likely that numeric is not what you want.   For instance, Pi is not numeric.  To allow for symbolic constants such as Pi as arguments, change numeric to realcons.  Here is the way I would do it:

if not type([args], list(realcons)) then return 'procname'(args) end if;

 

I have changed your notation so that the variables are now named x[1], x[2], etc., and the equations are dxdt[1], dxdt[2], etc.  This makes it easy to address them. Working with 2D input makes me mad, so I have converted your document to 1D math.

restart;

dxdt[1] := (1 - tau)*Theta__s - lambda__1*x[1] + q*b__c*x[5] - (mu + k__1)*x[1];
dxdt[2] := lambda__1*x[1] - (sigma__1 + delta__1 + mu)*x[2];
dxdt[3] := tau*Theta__s - lambda__2*x[3] + r*b__p*x[5] - (k__2*upsilon + mu)*x[3];
dxdt[4] := lambda__2*x[3] - (sigma__2 + mu + delta__2)*x[4];
dxdt[5] := k__1*x[1] + upsilon*k__2*x[3] - (b__c + b__p)*x[5] - mu*x[5];
dxdt[6] := (1 - q)*b__c*x[5] + (1 - r)*b__p*x[5] + sigma__1*x[2] + sigma__2*x[4] - (gamma + mu + delta__3)*x[6];
dxdt[7] := gamma*x[6] - mu*x[7];
dxdt[8] := -eta__1*x[8] + x[6]*xi__1;
dxdt[9] := -mu__r*x[9] - lambda__3*x[9] + Theta__r;
dxdt[10] := -mu__r*x[10] + lambda__3*x[9];
dxdt[11] := -eta__2*x[11] + x[10]*xi__2;

(1-tau)*Theta__s-lambda__1*x[1]+q*b__c*x[5]-(mu+k__1)*x[1]

lambda__1*x[1]-(sigma__1+delta__1+mu)*x[2]

tau*Theta__s-lambda__2*x[3]+r*b__p*x[5]-(k__2*upsilon+mu)*x[3]

lambda__2*x[3]-(sigma__2+mu+delta__2)*x[4]

k__1*x[1]+upsilon*k__2*x[3]-(b__c+b__p)*x[5]-mu*x[5]

(1-q)*b__c*x[5]+(1-r)*b__p*x[5]+sigma__1*x[2]+sigma__2*x[4]-(gamma+mu+delta__3)*x[6]

gamma*x[6]-mu*x[7]

-eta__1*x[8]+xi__1*x[6]

-mu__r*x[9]-lambda__3*x[9]+Theta__r

-mu__r*x[10]+lambda__3*x[9]

-eta__2*x[11]+xi__2*x[10]

sys := [ dxdt[i] $i=1..11 ];

[(1-tau)*Theta__s-lambda__1*x[1]+q*b__c*x[5]-(mu+k__1)*x[1], lambda__1*x[1]-(sigma__1+delta__1+mu)*x[2], tau*Theta__s-lambda__2*x[3]+r*b__p*x[5]-(k__2*upsilon+mu)*x[3], lambda__2*x[3]-(sigma__2+mu+delta__2)*x[4], k__1*x[1]+upsilon*k__2*x[3]-(b__c+b__p)*x[5]-mu*x[5], (1-q)*b__c*x[5]+(1-r)*b__p*x[5]+sigma__1*x[2]+sigma__2*x[4]-(gamma+mu+delta__3)*x[6], gamma*x[6]-mu*x[7], -eta__1*x[8]+xi__1*x[6], -mu__r*x[9]-lambda__3*x[9]+Theta__r, -mu__r*x[10]+lambda__3*x[9], -eta__2*x[11]+xi__2*x[10]]

nops(sys);

11

vars := [ x[i] $i=1..11 ];

[x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11]]

nops(vars);

11

indets(sys, name);

{b__c, b__p, eta__1, eta__2, gamma, k__1, k__2, mu, mu__r, q, r, tau, upsilon, xi__1, xi__2, Theta__r, Theta__s, delta__1, delta__2, delta__3, lambda__1, lambda__2, lambda__3, sigma__1, sigma__2, x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11]}

Calculate the equilibrium

E := solve(sys, vars)[]:

nops(E);

11

We calculate the system's the Jacobian:

interface(rtablesize=11):

Jac := Matrix(11, (i,j) -> diff(dxdt[i], x[j]));

Matrix(11, 11, {(1, 1) = -`#msub(mi("k"),mi("1"))`-mu-`#msub(mi("λ",fontstyle = "normal"),mi("1"))`, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = `#msub(mi("b"),mi("c"))`*q, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (2, 1) = `#msub(mi("λ",fontstyle = "normal"),mi("1"))`, (2, 2) = -mu-`#msub(mi("δ",fontstyle = "normal"),mi("1"))`-`#msub(mi("σ",fontstyle = "normal"),mi("1"))`, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -upsilon*`#msub(mi("k"),mi("2"))`-mu-`#msub(mi("λ",fontstyle = "normal"),mi("2"))`, (3, 4) = 0, (3, 5) = `#msub(mi("b"),mi("p"))`*r, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = `#msub(mi("λ",fontstyle = "normal"),mi("2"))`, (4, 4) = -mu-`#msub(mi("δ",fontstyle = "normal"),mi("2"))`-`#msub(mi("σ",fontstyle = "normal"),mi("2"))`, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (5, 1) = `#msub(mi("k"),mi("1"))`, (5, 2) = 0, (5, 3) = `#msub(mi("k"),mi("2"))`*upsilon, (5, 4) = 0, (5, 5) = -`#msub(mi("b"),mi("c"))`-`#msub(mi("b"),mi("p"))`-mu, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (6, 1) = 0, (6, 2) = `#msub(mi("σ",fontstyle = "normal"),mi("1"))`, (6, 3) = 0, (6, 4) = `#msub(mi("σ",fontstyle = "normal"),mi("2"))`, (6, 5) = (1-q)*`#msub(mi("b"),mi("c"))`+(1-r)*`#msub(mi("b"),mi("p"))`, (6, 6) = -gamma-mu-`#msub(mi("δ",fontstyle = "normal"),mi("3"))`, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = gamma, (7, 7) = -mu, (7, 8) = 0, (7, 9) = 0, (7, 10) = 0, (7, 11) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = `#msub(mi("ξ",fontstyle = "normal"),mi("1"))`, (8, 7) = 0, (8, 8) = -`#msub(mi("η",fontstyle = "normal"),mi("1"))`, (8, 9) = 0, (8, 10) = 0, (8, 11) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = -`#msub(mi("μ",fontstyle = "normal"),mi("r"))`-`#msub(mi("λ",fontstyle = "normal"),mi("3"))`, (9, 10) = 0, (9, 11) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = `#msub(mi("λ",fontstyle = "normal"),mi("3"))`, (10, 10) = -`#msub(mi("μ",fontstyle = "normal"),mi("r"))`, (10, 11) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = `#msub(mi("ξ",fontstyle = "normal"),mi("2"))`, (11, 11) = -`#msub(mi("η",fontstyle = "normal"),mi("2"))`})

We note, however, that the system is linear, and therefore the Jacobian is just the system's coefficient matrix

which is

Coeff_Matrix := LinearAlgebra:-GenerateMatrix(sys, vars);

Coeff_Matrix := Matrix(11, 11, {(1, 1) = -k__1-mu-`λ__1`, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = b__c*q, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (2, 1) = `λ__1`, (2, 2) = -mu-`δ__1`-`σ__1`, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -k__2*upsilon-mu-`λ__2`, (3, 4) = 0, (3, 5) = b__p*r, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = `λ__2`, (4, 4) = -mu-`δ__2`-`σ__2`, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (5, 1) = k__1, (5, 2) = 0, (5, 3) = k__2*upsilon, (5, 4) = 0, (5, 5) = -b__c-b__p-mu, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (6, 1) = 0, (6, 2) = `σ__1`, (6, 3) = 0, (6, 4) = `σ__2`, (6, 5) = (1-q)*b__c+(1-r)*b__p, (6, 6) = -gamma-mu-`δ__3`, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = gamma, (7, 7) = -mu, (7, 8) = 0, (7, 9) = 0, (7, 10) = 0, (7, 11) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = `ξ__1`, (8, 7) = 0, (8, 8) = -`η__1`, (8, 9) = 0, (8, 10) = 0, (8, 11) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = -`μ__r`-`λ__3`, (9, 10) = 0, (9, 11) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = `λ__3`, (10, 10) = -`μ__r`, (10, 11) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = `ξ__2`, (11, 11) = -`η__2`}), Vector(11, {(1) = -(1-tau)*`Θ__s`, (2) = 0, (3) = -tau*`Θ__s`, (4) = 0, (5) = 0, (6) = 0, (7) = 0, (8) = 0, (9) = -`Θ__r`, (10) = 0, (11) = 0})

Let's verify the Jacobian is exactly the coefficient matrix:

Jac - Coeff_Matrix[1];

Matrix(11, 11, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 0, (7, 10) = 0, (7, 11) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (8, 10) = 0, (8, 11) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0, (9, 10) = 0, (9, 11) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 0, (10, 10) = 0, (10, 11) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = 0, (11, 11) = 0})

The system's stability depends on the signs of the eigenvalues Jac. These can
be calculated explicitly.  The first three eigenvalues are HUGE expressions, so

we won't show them here.  The remaining 8 eigenvalues are neat, and all negative,

which is a good sign:

Eigs := LinearAlgebra:-Eigenvalues(Jac):

Eigs[4..-1];

Vector(8, {(1) = -mu-`#msub(mi("δ",fontstyle = "normal"),mi("1"))`-`#msub(mi("σ",fontstyle = "normal"),mi("1"))`, (2) = -mu-`#msub(mi("δ",fontstyle = "normal"),mi("2"))`-`#msub(mi("σ",fontstyle = "normal"),mi("2"))`, (3) = -gamma-mu-`#msub(mi("δ",fontstyle = "normal"),mi("3"))`, (4) = -mu, (5) = -`#msub(mi("η",fontstyle = "normal"),mi("1"))`, (6) = -`#msub(mi("μ",fontstyle = "normal"),mi("r"))`-`#msub(mi("λ",fontstyle = "normal"),mi("3"))`, (7) = -`#msub(mi("μ",fontstyle = "normal"),mi("r"))`, (8) = -`#msub(mi("η",fontstyle = "normal"),mi("2"))`})

I don't think that you can tell the signs of the first three eigenvalues (not shown) by looking at

their huge expressions.  But you can tell their signs if you have numerical values

of the system's parameters.

 

Download mw.mw

 

de := diff(Y(xi), xi) = mu*(1-Y(xi)^2);

diff(Y(xi), xi) = mu*(1-Y(xi)^2)

1st derivative

diff(u(Y(xi)),xi):
algsubs(de, %);

-(D(u))(Y(xi))*mu*(Y(xi)^2-1)

2nd derivative

diff(u(Y(xi)),xi,xi):
algsubs(de, %):
collect(%, D, simplify);

mu^2*(Y(xi)-1)^2*(Y(xi)+1)^2*((D@@2)(u))(Y(xi))+(2*mu^2*Y(xi)^3-2*mu^2*Y(xi))*(D(u))(Y(xi))

3rd derivative

diff(u(Y(xi)),xi,xi,xi):
algsubs(de, %):
collect(%, D, simplify);

-2*mu^3*(3*Y(xi)^4-4*Y(xi)^2+1)*(D(u))(Y(xi))-6*Y(xi)*mu^3*(Y(xi)-1)^2*(Y(xi)+1)^2*((D@@2)(u))(Y(xi))-mu^3*(Y(xi)-1)^3*(Y(xi)+1)^3*((D@@3)(u))(Y(xi))

4th derivative

diff(u(Y(xi)),xi,xi,xi,xi):
algsubs(de, %):
collect(%, D, simplify);

8*Y(xi)*mu^4*(3*Y(xi)^4-5*Y(xi)^2+2)*(D(u))(Y(xi))+4*mu^4*(9*Y(xi)^6-20*Y(xi)^4+13*Y(xi)^2-2)*((D@@2)(u))(Y(xi))+12*Y(xi)*mu^4*(Y(xi)-1)^3*(Y(xi)+1)^3*((D@@3)(u))(Y(xi))+mu^4*(Y(xi)-1)^4*(Y(xi)+1)^4*((D@@4)(u))(Y(xi))

 

Download mw.mw

 

This website does not allow me to post the contents of a Maple worksheet (something's broken?) so here is the text version of what I wanted to post.

We look at a nonlinear boundary value problem which has infinitely many solutions.  We specify three initial guesses which pick three different solutions.

restart;
de := diff(u(x),x,x) + surd(u(x),3)= 0;
bc := u(0) = 0, u(1) = 0;

# Solution #1
dsol := dsolve({de,bc}, numeric, method=bvp[midrich], approxsoln=[u(x)=x*(1-x)], maxmesh=200);
plots:-odeplot(dsol);

# Solution #2
dsol := dsolve({de,bc}, numeric, method=bvp[midrich], approxsoln=[u(x)=-x*(1-x)], maxmesh=200);
plots:-odeplot(dsol);

# Solution #3
dsol := dsolve({de,bc}, numeric, method=bvp[midrich], approxsoln=[u(x)=x*(1-x)*(x-1/2)], maxmesh=500);
plots:-odeplot(dsol);

[inserted by moderator]

restart;

de := diff(u(x),x,x) + surd(u(x),3)= 0;

diff(diff(u(x), x), x)+surd(u(x), 3) = 0

bc := u(0) = 0, u(1) = 0;

u(0) = 0, u(1) = 0

# Solution #1
dsol := dsolve({de,bc}, numeric, method=bvp[midrich], approxsoln=[u(x)=x*(1-x)], maxmesh=200):

plots:-odeplot(dsol);

# Solution #2
dsol := dsolve({de,bc}, numeric, method=bvp[midrich], approxsoln=[u(x)=-x*(1-x)], maxmesh=200):

plots:-odeplot(dsol);

# Solution #3
dsol := dsolve({de,bc}, numeric, method=bvp[midrich], approxsoln=[u(x)=x*(1-x)*(x-1/2)], maxmesh=500):

plots:-odeplot(dsol);

 

Download _BVP_with_infnitely_many_solutions.mw

restart;
with(plots):
f := (x,y) -> x^4 - 3*x^2 - 2*y^3 + 3*y + 0.5*x*y; 
solve( {diff(f(x,y),x)=0, diff(f(x,y),y)=0}, {x,y}):
(p->eval([x,y,f(x,y)],p))~([%]);
pointplot3d(%, symbol=solidsphere, symbolsize=20, color=red):
plot3d(f(x,y), x=-2..2, y=-2..2, style=surfacecontour, contours=20):
display(%%,%, view=-5..2, lightmodel=light1, orientation=[-90,0,0]);

 

 

Your worksheet is suffering from the 2D-math-input-syndrome.  I waded through it (painfully) and corrected a few errors here and there.  Here is the result.  Normally I wouldn't touch a 2D document with a 10-foot pole.

restart

t__1 := 1.05

1.05

x := proc (t) options operator, arrow; piecewise(0 <= t and t < t__1, -60*t+100, t__1 <= t and t <= T, 1.645*sqrt(480*t)) end proc

proc (t) options operator, arrow; piecewise(0 <= t and t < t__1, -60*t+100, t__1 <= t and t <= T, 1.645*sqrt(480*t)) end proc

de := diff(p(t), t) = 2*h*x(t)

diff(p(t), t) = 2*h*piecewise(0 <= t and t < 1.05, -60*t+100, 1.05 <= t and t <= T, 6.580*30^(1/2)*t^(1/2))

`assuming`([dsolve({de, p(T) = 0}, p(t))], [t > 0, t < T, T > t__1])

p(t) = piecewise(t < 21/20, -60*h*t^2+200*h*t-(2877/20)*h-(658/75)*h*30^(1/2)*T^(3/2)+(6909/500)*h*14^(1/2), 21/20 <= t, -(658/75)*h*30^(1/2)*T^(3/2)+(658/75)*h*30^(1/2)*t^(3/2))

NULL

 

Download dsol.mw

 

You must realize that what you have posted is not a good way of sharing your work with others.  Why not post a worksheet file (*.mw) like what most other people do?

And if you really want helpful input, you should document your work.  Explain what every step of the calculation is meant to do. Otherwise saying "it doesn't work" makes no sense since we don't know what you have in your head.

That said, I attempted to make sense of the mess that you have posted. It appears to me that the reason for "it doesn't work" is that at the very end you have

display([Head(0.3), Rod(), DikA, DikB, Crankpin(alpha)], ...

I think that the 0.3 in Head(0.3) should be a variable, but since you have not explained your notation, I have no idea what it is supposed to be.

I gather from what I could understand, that you want to do something like this:

See how that's done in this worksheet:  mw.mw

This does exactly what you want.

restart;
with(Physics[Vectors]):
Typesetting:-Settings(typesetdot=true):
r_(t) = ChangeBasis(rhs(r_(t) = x(t)*_i + y(t)*_j), cylindrical, alsocomponents);
OM_ := r(t)*_rho(t);
v_ := diff(OM_, t);
a_ := diff(v_, t);

Added later: Actually the line r_(t) = Change... is not needed.  Delete.

The number that you have calculated for the answer to part (a) is correct but I cannot see the logic behind that calculation.  You may want to explain your reasoning.  Here is my calculation:

params := rho=1000, g=9.81, R=1/2, H=2;   # H=height, R=radius
W := int((H-y)*rho*g*Pi*(R/H*y)^2, y=0..H);
eval(W, {params});

which yields 2568.251995, the same as yours.  For parts (b) and (c) I get 13080π and 39240π.

 

Printing that is the easy part:

for i from 1 to 3 do
  print(A^cat(`<`,i,`>`) = Mat(i));
end do;

A^`<1>` = Mat(1)

A^`<2>` = Mat(2)

A^`<3>` = Mat(3)

What you want to do with the result is something else.

@erik10 See if this is what you want.

restart;

Removes all characters other than a-z and å, æ, ø (and their uppercase versions)

from the string str.  Returns a matrix of cols columns whose entries are the

remaining characters in str. The last row is padded with zeros if needed.

do_Danish := proc(str, cols)
        local len, syms, rows;
        uses Python;
        ImportModule("re");
        sprintf("re.split(\"[^a-zA-ZåæøÅÆØ]*\", %a)", str);
        Python:-EvalString(%);
        remove(has, %, "");
        syms := convert~(%, symbol);
        len := nops(syms);
        print(convert(cat("number of chars = ", len), name));
        rows := iquo(len-1, cols) + 1;
        interface(rtablesize = max(rows, cols));
        Matrix(rows, cols, syms);
end proc:

 

 

Text := "This is a Dånish tæxtø: @X#!ÅÆØ";

"This is a Dånish tæxtø: @X#!ÅÆØ"

do_Danish(Text, 11);

`number of chars = 22`

Matrix(%id = 36893627851096899444)

do_Danish(Text, 16);

`number of chars = 22`

Matrix(%id = 36893627851096894868)

do_Danish(Text, 5);

`number of chars = 22`

Matrix(%id = 36893627851096883316)

Note: The message on the output says "number of chars = 22".  The "22" is shown properly in the worksheet but comes out broken on this website. Not my fault.

Download mw.mw

restart;

with(StringTools):

String S0 is given:

S0 := "This is a test. This is only a test";

"This is a test. This is only a test"

Remove all characters other than a-z:

S1 := Select~(IsLower, S0);

"hisisatesthisisonlyatest"

Convert S1 to a list of characters:

S2 := Explode(S1);

["h", "i", "s", "i", "s", "a", "t", "e", "s", "t", "h", "i", "s", "i", "s", "o", "n", "l", "y", "a", "t", "e", "s", "t"]

Optionally, convert the entries of S2 to symbols:

S3 := convert~(S2, symbol);

[h, i, s, i, s, a, t, e, s, t, h, i, s, i, s, o, n, l, y, a, t, e, s, t]

Put S3 into a matrx

Matrix(6,6, S3);

Matrix(6, 6, {(1, 1) = h, (1, 2) = i, (1, 3) = s, (1, 4) = i, (1, 5) = s, (1, 6) = a, (2, 1) = t, (2, 2) = e, (2, 3) = s, (2, 4) = t, (2, 5) = h, (2, 6) = i, (3, 1) = s, (3, 2) = i, (3, 3) = s, (3, 4) = o, (3, 5) = n, (3, 6) = l, (4, 1) = y, (4, 2) = a, (4, 3) = t, (4, 4) = e, (4, 5) = s, (4, 6) = t, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0})

Download mw.mw

If you solve the equation x^2 + y^2 = 4 for y, you will get two solutions, y=±sqrt(4 - x^2). The plus sign gives the equation of the upper half of the circle, and the minus sign gives the equation of the lower half. So the answer to Part (a) is y = sqrt(4 - x^2), and the plot is produced by

plot(sqrt(4 - x^2), x=-2..2, scaling=constrained);

As to part (b): Rotating that semicircle about the x axis produces a sphere of radius 2.

As to part (c): The volume enclosed by the sphere is given by the formula Vx that you have shown in your post. We have f(x) = sqrt(4 - x^2), and therefore f(x)^2 = 4 - x^2.  So the volume is:

V__x := Pi*int( 4 - x^2, x = -2 .. 2);

 

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