acer

29759 Reputation

29 Badges

19 years, 316 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

You were failing to provide any knowledge of f to the attempts at computing c5,c6,c7.

I resolved that issue by calling dsolve on a coupled system -- once, for each set of parameter values. (Yes, you could dsolve for f alone, decoupled, and then reuse that result in the later dsolve calls for theta. But efficiency seems not a major concern in what you've attempted here. I'm just trying to keep it simpler for you to do -- it's just a judgement call, on what might be best for you.)

In at least one place you also had f instead of f(x). That's the kind of mistake you can make when you allow declare to make things visually unclear.

You had duplicates of most of the parameter information. I've cleaned all that up and made it more organized, which might help you keep track of which is what. Having twice as many solutions as necessary floating around, with numbering mismatches, seems a recipe for confusion.

Note that M only appears in eq1, and is multiplied by sin(alpha).
Hence M has no effect when sin(alpha) is taken as 0, which is the case for all your given parameter sets.

So I rearranged the parameter sets according to the value for cos(omega). And I added a legend. We can see that for your parameter sets it is the value of cos(omega) that is the key difference.

restart

kernelopts(version);

`Maple 18.02, X86 64 LINUX, Oct 20 2014, Build ID 991181`

with(PDETools, declare):

with(plots):

eq1 := diff(f(x), x, x, x) + 1/2*(1 - phi)^2.5*(1 - phi + phi*rho[s]/rho[fl])*(eta*cos(omega) + f(x)*sin(omega))*diff(f(x), x, x) + (1 - phi)^2.5*M*sin(alpha)^2*(1 - diff(f(x), x)) + (1 - phi)^2.5*(1 - phi + phi*`ρβ`[s]/`ρβ`[fl])*Gr[x]*`cosγ`*theta = 0;

diff(diff(diff(f(x), x), x), x)+(1/2)*(1-phi)^2.5*(1-phi+phi*rho[s]/rho[fl])*(eta*cos(omega)+f(x)*sin(omega))*(diff(diff(f(x), x), x))+(1-phi)^2.5*M*sin(alpha)^2*(1-(diff(f(x), x)))+(1-phi)^2.5*(1-phi+phi*`ρβ`[s]/`ρβ`[fl])*Gr[x]*`cosγ`*theta = 0

eq2 := K[nf]*diff(theta(x), x, x)/K[f] + Pr/2*(eta*cos(omega) + f(x)*sin(omega))*diff(theta(x), x) = 0;

K[nf]*(diff(diff(theta(x), x), x))/K[f]+(1/2)*Pr*(eta*cos(omega)+f(x)*sin(omega))*(diff(theta(x), x)) = 0

bcs := f(0) = 0, (D(f))(0) = 0, (D(f))(10) = 1;

f(0) = 0, (D(f))(0) = 0, (D(f))(10) = 1

theta(0) = 1, theta(10) = 0

a1 := [phi = .1, rho[s] = 5200, rho[fl] = 997.1, `ρβ`[s] = 6500, `ρβ`[fl] = 20939.1, M = 0, sin(alpha) = 0, cos(omega) = 1, sin(omega) = 0, Gr[x] = 0, Pr = 6.2, cos*gamma = 1, eta = 3, K[f] = .613, K[nf] = .6842]:

Note that M only appears in eq1, multiplied by sin(alpha).
Hence M has no effect when sin(alpha) is taken as 0.

c1 := dsolve({bcs, bcs1, subs(a1, eq1), subs(a1, eq2)}, numeric):

TFP := Typesetting:-Typeset(diff(f(x), x)):

display(p1, p2, p3, p4, p5, p6, p7, p8, thickness = 3, legendstyle = [location = right], size = [700, 450]);

NULL

Download IP-TEMP_ac.mw

You might wish to also try varying the sin(alpha) parameter, and then see the related effects of varying M.

The keen observer might notice that there is a lot in common amongst all those dsolve and odeplot calls. There is so much that could be generalized. But I've deliberately chosen not to wrap it all up in a single resuable procedure that could produce all the results.

There are a lot of members on this forum who attempt very similar problems. Several struggle with numeric dsolve & odeplot, and perhaps even with the DE concepts. I think that some members can learn more by doing each step themselves rather than use an abstracted do-it-all solution procedure.

The following was done using Maple 2023.0.

Where you see R subscripted by x it was entered as the keystrokes R__x with two underscores, and similarly for y and z subscripts.

restart;

`print/sin` := proc(t) ':-s'(t); end proc:
`print/cos` := proc(t) ':-c'(t); end proc:
(s,c) := sin,cos:

Typesetting:-Suppress(x(t));

Typesetting:-Settings(prime=t):
Typesetting:-Settings(typesetprime=true):
Typesetting:-Settings(useprime=true):

 

R__z := proc (A) options operator, arrow; `<,>`(`<|>`(c(A), s(A), 0), `<|>`(-s(A), c(A), 0), `<|>`(0, 0, 1)) end proc

R__x := proc (A) options operator, arrow; `<,>`(`<|>`(1, 0, 0), `<|>`(0, c(A), -s(A)), `<|>`(0, s(A), c(A))) end proc

R__y := proc (A) options operator, arrow; `<,>`(`<|>`(c(A), 0, s(A)), `<|>`(0, 1, 0), `<|>`(-s(A), 0, c(A))) end proc

 

R__z(psi)

Matrix(%id = 36893628812889702516)

 

simplify(R__x(phi).R__y(theta).R__z(psi))

Matrix(%id = 36893628812889688652)

diff(c(x)*s(x), t)

-(diff(x(t), t))*sin(x(t))^2+cos(x(t))^2*(diff(x(t), t))

diff(c(x)*s(x), t)

-(diff(x(t), t))*sin(x(t))^2+cos(x(t))^2*(diff(x(t), t))

diff(c(x)*s(x), x)

-(diff(x(t), t))*sin(x(t))^2+cos(x(t))^2*(diff(x(t), t))


In case it's not clear from the above, the outputs below do indeed
contain references to sin and cos proper. For instance,

c(x)*s(x)

cos(x(t))*sin(x(t))

`~`[has](%, [sin, cos])

[true, true]

combine(`%%`)

(1/2)*sin(2*x(t))

simplify(s(x)^2+c(x)^2)

1

Download sincos_ts.mw

The code in red above could be tucked away out of sight in a worksheet's Startup Code, accessible via the main menubar's Edit menu.

ps. I could mention that the first three lines of red code, which assigns to (s,c) and the print-extensions, could be replaced by alias, as Edgardo mentioned. My longstanding preference is not to use alias, which is why I didn't mention it earlier. The rest of the red code, the Typesetting calls, accomplish the rest of the aspects you mentioned or showed.

That lengthy result you obtained appears to have a "hidden" division-by-zero in it. I suspect that you might not be able to just simplify that away, given that form.

But the option method=trager to the int command seems to help here.

restart;

kernelopts(version);

`Maple 2023.0, X86 64 LINUX, Mar 06 2023, Build ID 1689885`

ig[1] := 1/(z^2+sqrt(z^4+4*a*z^2)+4*a);

1/(z^2+(z^4+4*a*z^2)^(1/2)+4*a)

ans[1]:=int(ig[1],z,method=trager);

(1/4)*(z-1-(z^4+4*a*z^2)^(1/2)/z)/a

normal( diff(ans[1],z) - ig[1] );

0

ig[2] := -1/(z^2-sqrt(z^4+4*a*z^2)+4*a);

-1/(z^2-(z^4+4*a*z^2)^(1/2)+4*a)

ans[2]:=int(ig[2],z,method=trager);

(1/4)*(1-z-(z^4+4*a*z^2)^(1/2)/z)/a

normal( diff(ans[2],z) - ig[2] );

0

Download int_tr_ex.mw

I don't know all the details of the control flow by which available methods are attempted by default for indefinite integration. I'll submit this example as a bug report.

Consider this counterexample, where x=-1.

ee := (x^(3))^(1/3)

(x^3)^(1/3)

simplify(ee);

(x^3)^(1/3)

simplify(ee) assuming x>=0;

x

r := evala( eval(ee, x=-1) );

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

simplify(r^3);

-1

simplify( ( -1 )^3 );

-1

simplify( ( 1/2+sqrt(-3)/2 )^3 );

-1

simplify( ( 1/2-sqrt(-3)/2 )^3 );

-1

S := [solve( x^3 = -1, x)];

[-1, 1/2-((1/2)*I)*3^(1/2), 1/2+((1/2)*I)*3^(1/2)]

plots:-display(
  plottools:-circle([0,0],1,color=blue),
  plots:-pointplot([Re,Im]~(S),
                   symbol=solidcircle, symbolsize=20,
                   color=red, size=[300,300]));

Download cbrt.mw

Perhaps a suitable time to review the documentation for the root (esp. 4th and 5th bullet points) and surd commands.

This particular example can be handled in one call to fsolve.

restart;

kernelopts(version);

`Maple 2023.0, X86 64 LINUX, Mar 06 2023, Build ID 1689885`

R := RootOf(_Z*cos(_Z) - sqrt(sin(_Z)^2));

RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))

arg := eval(op(1,R), _Z=x);

x*cos(x)-(sin(x)^2)^(1/2)

fsolve(arg, x=-6..6, maxsols=infinity);

-4.493409458, -2.028757838, 0., 4.913180439

fsolve(arg, x=-6..6, maxsols=infinity, method=NextZero);

-4.493409458, -2.028757839, 0., 4.913180439

Download rf_ex.mw

note: Given a numeric rootfinder, some example can be found that defeats it.

The contents of the Favorites palette are stored in a location on one's Operating System, somewhat similarly to how one's Maple GUI preferences are saved.

They are not saved inside an individual .mw file.

Also, Maple preferences are stored on the local computer, say, not in the cloud.

The contents of the palettes is part of the GUI itself, not the document.

Once you've created the plot using geometry:-draw, you could merge it with other kinds of plots in the usual way, ie. using plots:-display.

restart; with(geometry)

point(B, 2, 0)

B

form(B)

point2d

coordinates(B)

[2, 0]

The following uses geometry:-draw

draw(B)draw(B)

draw(B, color = blue, symbol = solidcircle)

NULL

Download plotpoint_ac.mw

You can replace those function calls (of t). You could do it using evalindets, and also with eval and a set/list of replacements.

This targets those particular names, but it'd also work if you had terms like sin(t), etc, leaving those alone.

problem_ach_ac.mw

restart;

with(LinearAlgebra):

n := Vector[row]([cos(theta(x, y, t)), sin(theta(x, y, t))]);

Vector[row](2, {(1) = cos(theta(x, y, t)), (2) = sin(theta(x, y, t))})

add(n[i]^2, i = 1 .. 2);

cos(theta(x, y, t))^2+sin(theta(x, y, t))^2

 

The next automatically simplifies to the previous...

 

add(n[i]*n[i], i = 1 .. 2);

cos(theta(x, y, t))^2+sin(theta(x, y, t))^2

 

If your Vector has just two entries, then isn't the next
simplest as well efficient?

 

n[1]^2+n[2]^2;

cos(theta(x, y, t))^2+sin(theta(x, y, t))^2

 

The next two work, but are unnecessarily complicated
because there's no great reason here to use Multiply(n[i],n[i]),
where Multiply is a LinearAlgebra command, since each n[i]
is just a scalar.

 

add(Multiply(n[i], n[i]), i = 1 .. 2);

cos(theta(x, y, t))^2+sin(theta(x, y, t))^2

sum('Multiply(n[i], n[i])', i = 1 .. 2)

cos(theta(x, y, t))^2+sin(theta(x, y, t))^2

 

Alternatives...

 

DotProduct(n,n,conjugate=false);

cos(theta(x, y, t))^2+sin(theta(x, y, t))^2

 

The next each unnecessarily produce a temporary
Vector as garbage for memory management.

 

n.n^%T;

cos(theta(x, y, t))^2+sin(theta(x, y, t))^2

add(n*~n);

cos(theta(x, y, t))^2+sin(theta(x, y, t))^2

add(n^~2);

cos(theta(x, y, t))^2+sin(theta(x, y, t))^2

Download vec_dot_add.mw

Is this the kind of thing you meant?

eq := diff(w(x), x, x) = F*(6*(-a^2/(2*L^2) + a^3/(3*L^3))*x + 2*a^2/L - a^3/L^2)/EI;

diff(diff(w(x), x), x) = F*(6*(-(1/2)*a^2/L^2+(1/3)*a^3/L^3)*x+2*a^2/L-a^3/L^2)/EI

(lhs=simplify@value@rhs)(map(Eval,eq,x=L));

Eval(diff(diff(w(x), x), x), x = L) = -F*a^2*(L-a)/(L^2*EI)

Download comp_map.mw

Do you mean something like this, to get that data into the columns of B?

  M0:=Edges~(graphs);
  M1:=Girth~(graphs);
  M2:=Diameter~(graphs);
  B := <<M0>|<M1>|<M2>>:

And then, as you had it,

  Export(..., B);

or, say,

  Export(..., B, format="delimited"):

or some flavour of call to ExportMatrix, etc.

Here are three straightforward ways to map that operation across your ptlist,

   (u->TransMatrix.u)~(ptlist);

   map(u->TransMatrix.u, ptlist);

   map[2](`.`, TransMatrix, ptlist);

Are you trying to accomplish something like this, using the command Physics:-diff to differentiate wrt the function call u(t)?

note: what you showed in plaintext is not valid 1D Maple Notation code, so I've guessed at what you might have intended. Adjust as needed.

restart;
H:=(y,u,t)->y(t)^2+u(t)^2+1/(2)(x(t))^(4) +(`&PartialD;/&PartialD; x`)(V(t))*u(t):

Physics:-diff(H(y,u,t), u(t));

   2*u(t)+(`&PartialD;/&PartialD; x`)(V(t))

H:=(y,u,t)->y(t)^2+u(t)^2+1/(2)(x(t))^(4) + Diff(V(t),x)*u(t):

Physics:-diff(H(y,u,t), u(t));

        2*u(t)+Diff(V(t),x)

You haven't shown us your actual expression. But you might be able to temporarily substitute for x-x0, then collect, then resubstitute.

Btw, your attempt using abs(x-x0) works as a specialized case of collecting wrt just abs.

restart;

expr := c*abs(x-x0) + d*abs(x-x0) + a*(x-x0) + b*x -b*x0 + abs(u) + e*abs(u);

c*abs(x-x0)+d*abs(x-x0)+a*(x-x0)+b*x-b*x0+abs(u)+e*abs(u)

collect(expr, abs(x-x0));

(c+d)*abs(x-x0)+a*(x-x0)+b*x-b*x0+abs(u)+e*abs(u)

collect(expr, abs);

(1+e)*abs(u)+(c+d)*abs(x-x0)+a*(x-x0)+b*x-b*x0

collect(exp, x-x0);

Error, (in collect) cannot collect x-x0

rev := v=x-x0;
temp := algsubs(x-x0=v, expr);

v = x-x0

c*abs(v)+d*abs(v)+e*abs(u)+a*v+b*v+abs(u)

eval( collect(temp, v), rev );

(a+b)*(x-x0)+c*abs(x-x0)+d*abs(x-x0)+e*abs(u)+abs(u)

# now also target abs(x-x0)
eval( collect(temp, [v,abs(v)]), rev );

(a+b)*(x-x0)+(c+d)*abs(x-x0)+e*abs(u)+abs(u)

# now also target all abs calls
eval( collect(temp, [v,abs]), rev );

(a+b)*(x-x0)+(1+e)*abs(u)+(c+d)*abs(x-x0)

Download collect_algsubs.mw

The results from implicitplot3d often look clunky, and sometimes edges inaccurately appear rounded, unless the sampling grid option is set so high that the GUI becomes sluggish when they are manually rotated, etc. It is an inefficient mechanism. It is a poor choice for handling this example.

I prefer to use plot3d when possible. Or, in this case, the tetrahedron plotting command can be used and produce an even more lightweight result.

Both of those can produce a much better rendition here than does implicitplot3d

restart;

with(plots): with(plottools):

display(tetrahedron([[0,0,0],[0,1,1],[1,1,1],[0,0,1]]), labels=[x,y,z]);

G := plot3d(y-1, x=0..1, y=x..1, filled, style=surface):
R := transform((x,y,z)->[x,y,z+1])(G):
display(R, labels=[x,y,z], glossiness=0);

Download tetra.mw

Unfortunately shadebetween cannot handle a variable range end-point. Hence my alternative was to fill a plot3d of y-1 and then raise by 1.

First 18 19 20 21 22 23 24 Last Page 20 of 309