acer

32303 Reputation

29 Badges

19 years, 309 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

The following replaces all names of the form `x` followed by a positive integer.

It handles your set of names assigned to t, and it doesn't matter how many such names there are.

It also allows you to make such replacements within expressions more generally.

restart;

t:={seq(x||i,i=1..100)};

{x1, x10, x100, x11, x12, x13, x14, x15, x16, x17, x18, x19, x2, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x3, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x4, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x5, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x6, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x7, x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x8, x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x9, x90, x91, x92, x93, x94, x95, x96, x97, x98, x99}

subsindets(t, 'suffixed(x,posint)',
           nm->cat('y',String(nm)[2..]));

{y1, y10, y100, y11, y12, y13, y14, y15, y16, y17, y18, y19, y2, y20, y21, y22, y23, y24, y25, y26, y27, y28, y29, y3, y30, y31, y32, y33, y34, y35, y36, y37, y38, y39, y4, y40, y41, y42, y43, y44, y45, y46, y47, y48, y49, y5, y50, y51, y52, y53, y54, y55, y56, y57, y58, y59, y6, y60, y61, y62, y63, y64, y65, y66, y67, y68, y69, y7, y70, y71, y72, y73, y74, y75, y76, y77, y78, y79, y8, y80, y81, y82, y83, y84, y85, y86, y87, y88, y89, y9, y90, y91, y92, y93, y94, y95, y96, y97, y98, y99}

expr := x1*x2 + x5^2 + sin(x117);

x1*x2+x5^2+sin(x117)

subsindets(expr, 'suffixed(x,posint)',
           nm->cat('y',String(nm)[2..]));

y1*y2+y5^2+sin(y117)

Download subsind_ex.mw

If you know that there are just that particular 100 such names then you could do it more tersely like, say,

   subs('x||i=y||i'$i=1..100,t);
or,
   subs('x||i=y||i'$i=1..100,expr);

Or, using it more than once,

   S:='x||i=y||i'$i=1..100:
   subs(S,t);
   subs(S,expr);

Don't make the assignment to C if you want it to remain as an unassigned name.

It looks as if you wanted to use only an equation involving C, not an assignment.

restart;

rho := `ρg`*ng + `ρp`*np + `ρw`*nw;

`ρg`*ng+`ρp`*np+`ρw`*nw

B := np/Kp + nw/Kw + ng/Kg;

np/Kp+nw/Kw+ng/Kg

eqn := C = (B/rho)^(1/2);

C = ((np/Kp+nw/Kw+ng/Kg)/(`ρg`*ng+`ρp`*np+`ρw`*nw))^(1/2)

isolate( eqn, ng );

ng = -Kg*(`ρp`*C^2*Kp*Kw*np+`ρw`*C^2*Kp*Kw*nw-Kp*nw-Kw*np)/(Kw*Kp*(`ρg`*C^2*Kg-1))

Download isol.mw

You wrote of expressing them in terms of each other.

I'd be interested to know whether your wider investigations might have any use for expressing them all ("compactly") in terms of additional temporary variables.

For example,

restart

t__1 := (`σ__v`[2]^2*(`ρ__v`[1, 2]^2-1)-`σ__ε2`^2)*`σ__v`[1]^2/((`σ__v`[2]^2*(`ρ__v`[1, 2]^2-1)-`σ__ε2`^2)*`σ__v`[1]^2-`σ__ε1`^2*(`σ__ε2`^2+`σ__v`[2]^2))

t__2 := -`σ__v`[1]*`ρ__v`[1, 2]*`σ__v`[2]*`σ__ε1`^2/((`σ__v`[2]^2*(`ρ__v`[1, 2]^2-1)-`σ__ε2`^2)*`σ__v`[1]^2-`σ__ε1`^2*(`σ__ε2`^2+`σ__v`[2]^2))

t__3 := (`σ__v`[1]*`ρ__v`[1, 2]*`σ__v`[2]*`σ__ε1`^2*`ν__0`[2]-`ν__0`[1]*`σ__ε1`^2*(`σ__ε2`^2+`σ__v`[2]^2))/((`σ__v`[2]^2*(`ρ__v`[1, 2]^2-1)-`σ__ε2`^2)*`σ__v`[1]^2-`σ__ε1`^2*(`σ__ε2`^2+`σ__v`[2]^2))

 

a1 := `σ__ε1`^2

a2 := `σ__ε2`^2+`σ__v`[2]^2

a3 := (`σ__v`[2]^2*(`ρ__v`[1, 2]^2-1)-`σ__ε2`^2)*`σ__v`[1]^2

a4 := 1/(-a1*a2+a3)

a5 := a1*a4

a6 := `σ__v`[1]*`ρ__v`[1, 2]*`σ__v`[2]

[a3*a4, -a5*a6, a5*(-a2*`ν__0`[1]+a6*`ν__0`[2])]

[(sigma__v[2]^2*(rho__v[1, 2]^2-1)-`σ__ε2`^2)*sigma__v[1]^2/((sigma__v[2]^2*(rho__v[1, 2]^2-1)-`σ__ε2`^2)*sigma__v[1]^2-`σ__ε1`^2*(`σ__ε2`^2+sigma__v[2]^2)), -sigma__v[1]*rho__v[1, 2]*sigma__v[2]*`σ__ε1`^2/((sigma__v[2]^2*(rho__v[1, 2]^2-1)-`σ__ε2`^2)*sigma__v[1]^2-`σ__ε1`^2*(`σ__ε2`^2+sigma__v[2]^2)), `σ__ε1`^2*(-(`σ__ε2`^2+sigma__v[2]^2)*nu__0[1]+sigma__v[1]*rho__v[1, 2]*sigma__v[2]*nu__0[2])/((sigma__v[2]^2*(rho__v[1, 2]^2-1)-`σ__ε2`^2)*sigma__v[1]^2-`σ__ε1`^2*(`σ__ε2`^2+sigma__v[2]^2))]

Download rearrangingterms_q2.mw

I made those additional temporary substitutions as assignments. But they could also be formulated as a sequence of equations (for substitution into each other, up the chain).

You could optionally (telescopically) collapse a portion of that sequence of subsitutions, from the top down.  Eg, you could retain only the knowledge in a5 & a6, or what have you.

Also, such a scheme can also support a wider set of operations (expression forms) than just mere polynomials. For polynomials there are various techniques (basis, triangularization, etc) to produce such a substituion chain. But there are also mechanisms for doing it for a wider (non-polynomial) class.

The five you cited can be found pretty quickly, and exactly, as follows.

restart;

nsd := 16*a*b*c*(9 + a^2 + b^2 + c^2)*(b*c + a*(b + c) + 3*(a + b + c))
       - (3 + a + b + c)^2*(a*b + 3*c)*(3*b + a*c)*(3*a + b*c):

nsdac := eval(nsd,{c=a}):
rawac := solve({nsdac,a>0,b>0},[a,b]):
solac := map(s->{s[],c=eval(a,s)},rawac);

    solac := [{a = 1, b = 1, c = 1}, {a = 3, b = 3, c = 3}, 
              {a = 3, b = 9, c = 3}]

eval~(nsd, solac);

                 [0, 0, 0]

The remaining pair can be had immediately by noticing/proving the symmetry, or by re-running with each of the corresponding substitutions c=b and b=a.

Proving that there are no other solutions seems difficult or time-consuming. Let's see...

You mistakenly placed the call to polygonplot inside the call to draw.

restart;

with(geometry):  

with(plots):  

_EnvHorizontalName = 'x':  _EnvVerticalName = 'y':

point(A, -1, 9):
point(B, -5, 0):
point(C, 6, 0):
triangle(ABC,[A,B,C]):
midpoint(M1,A,C): midpoint(M2,B,C):midpoint(M3,A,B):
rotation(J, C, Pi/2, 'counterclockwise', M1):triangle(AJC,[A,J,C]):
rotation(Ii, C, Pi/2, 'counterclockwise', M2):triangle(BIC,[B,Ii,C]):
rotation(K, A, Pi/2, 'counterclockwise', M3):triangle(AKB,[A,K,B]):
midpoint(O1,K,J): coordinates(O1):
midpoint(O2,A,Ii): coordinates(O2):  
poly:=[coordinates(A),coordinates(J),coordinates(Ii),coordinates(K)]:

display(
  draw([A(color = black, symbol = solidcircle, symbolsize = 12),
        B(color = black, symbol = solidcircle, symbolsize = 12),
        C(color = black, symbol = solidcircle, symbolsize = 12),
        J(color = black, symbol = solidcircle, symbolsize = 12),
        ABC(color = red ),
        BIC(color = green),
        AKB(color = grey),
        AJC(color =blue)]),
  polygonplot(poly,color = "DarkGreen", transparency = 0.5),
  textplot([[coordinates(A)[], "A"],[coordinates(J)[], "J"],[coordinates(Ii)[], "I"],   
  [coordinates(B)[], "B"], [coordinates(K)[], "K"],
  [coordinates(C)[], "C"]],
  align = [above, right]),  axes = none);

 

Download jamet_ex.mw

Are you trying to get an effect something like one of these?

restart:

aa := alpha[1]*(cos(theta(x, y, t))^4*dudx^2+2*cos(theta(x, y, t))^3*dudx*sin(theta(x, y, t))*dvdx+2*cos(theta(x, y, t))^3*dudx*sin(theta(x, y, t))*dudy+2*cos(theta(x, y, t))^2*dudx*sin(theta(x, y, t))^2*dvdy+cos(theta(x, y, t))^2*sin(theta(x, y, t))^2*dvdx^2+2*cos(theta(x, y, t))^2*sin(theta(x, y, t))^2*dvdx*dudy+2*cos(theta(x, y, t))*sin(theta(x, y, t))^3*dvdx*dvdy+cos(theta(x, y, t))^2*sin(theta(x, y, t))^2*dudy^2+2*cos(theta(x, y, t))*sin(theta(x, y, t))^3*dudy*dvdy+sin(theta(x, y, t))^4*dvdy^2)+(alpha[2]+alpha[3]+gamma[2])*(-dudx*cos(theta(x, y, t))*sin(theta(x, y, t))*thetadot-(1/2)*dudx*cos(theta(x, y, t))*sin(theta(x, y, t))*dudy+(1/2)*dudx*cos(theta(x, y, t))*sin(theta(x, y, t))*dvdx+(1/2)*cos(theta(x, y, t))^2*dvdx*thetadot-(1/4)*cos(theta(x, y, t))^2*dvdx^2+(1/2)*cos(theta(x, y, t))^2*dudy*thetadot+(1/4)*cos(theta(x, y, t))^2*dudy^2-(1/2)*sin(theta(x, y, t))^2*dvdx*thetadot+(1/4)*sin(theta(x, y, t))^2*dvdx^2-(1/2)*sin(theta(x, y, t))^2*dudy*thetadot-(1/4)*sin(theta(x, y, t))^2*dudy^2+dvdy*sin(theta(x, y, t))*cos(theta(x, y, t))*thetadot-(1/2)*dvdy*sin(theta(x, y, t))*cos(theta(x, y, t))*dvdx+(1/2)*dvdy*sin(theta(x, y, t))*cos(theta(x, y, t))*dudy)+alpha[4]*(dudx^2+(1/2)*dvdx^2+dvdx*dudy+(1/2)*dudy^2+dvdy^2)+(alpha[5]+alpha[6])*(cos(theta(x, y, t))^2*dudx^2+2*cos(theta(x, y, t))*dudx*((1/2)*dvdx+(1/2)*dudy)*sin(theta(x, y, t))+cos(theta(x, y, t))^2*((1/2)*dvdx+(1/2)*dudy)^2+2*cos(theta(x, y, t))*((1/2)*dvdx+(1/2)*dudy)*dvdy*sin(theta(x, y, t))+sin(theta(x, y, t))^2*((1/2)*dvdx+(1/2)*dudy)^2+sin(theta(x, y, t))^2*dvdy^2)+gamma[1]*(sin(theta(x, y, t))^2*thetadot^2+sin(theta(x, y, t))^2*dudy*thetadot-sin(theta(x, y, t))^2*dvdx*thetadot+(1/4)*sin(theta(x, y, t))^2*dudy^2-(1/2)*sin(theta(x, y, t))^2*dudy*dvdx+(1/4)*sin(theta(x, y, t))^2*dvdx^2+cos(theta(x, y, t))^2*thetadot^2-cos(theta(x, y, t))^2*dvdx*thetadot+cos(theta(x, y, t))^2*dudy*thetadot+(1/4)*cos(theta(x, y, t))^2*dvdx^2-(1/2)*cos(theta(x, y, t))^2*dudy*dvdx+(1/4)*cos(theta(x, y, t))^2*dudy^2)+xi*(cos(theta(x, y, t))^2*dudx+2*cos(theta(x, y, t))*sin(theta(x, y, t))*((1/2)*dvdx+(1/2)*dudy)+sin(theta(x, y, t))^2*dvdy):

temp1 := (coeff(aa,dudy^2))*dudy^2 + (coeff(aa,dudy^2))*dvdx^2:

eq := dudy^2+dvdx^2=PP: reveq := (rhs=lhs)(eq):

 

subs(reveq,collect(algsubs(eq,temp1),PP,simplify));

(-cos(theta(x, y, t))^4*alpha[1]+(1/4)*(2*gamma[2]+4*alpha[1]+2*alpha[2]+2*alpha[3])*cos(theta(x, y, t))^2+(1/4)*gamma[1]-(1/4)*gamma[2]-(1/4)*alpha[2]-(1/4)*alpha[3]+(1/2)*alpha[4]+(1/4)*alpha[5]+(1/4)*alpha[6])*(dudy^2+dvdx^2)

subs(reveq,collect(algsubs(eq,temp1),PP,u->simplify(u,size)));

((1/4)*(4*sin(theta(x, y, t))^2*alpha[1]+gamma[1]+gamma[2]+alpha[2]+alpha[3]+alpha[5]+alpha[6])*cos(theta(x, y, t))^2+(1/4)*(gamma[1]-gamma[2]-alpha[2]-alpha[3]+alpha[5]+alpha[6])*sin(theta(x, y, t))^2+(1/2)*alpha[4])*(dudy^2+dvdx^2)

temp2 := subs({gamma[1] = alpha[3]-alpha[2],
         gamma[2] = alpha[6]-alpha[5]}, temp1):

 

subs(reveq,collect(algsubs(eq,temp2),[PP],u->simplify(u,size)));

((1/2)*(2*sin(theta(x, y, t))^2*alpha[1]+alpha[3]+alpha[6])*cos(theta(x, y, t))^2+(1/2)*(-alpha[2]+alpha[5])*sin(theta(x, y, t))^2+(1/2)*alpha[4])*(dudy^2+dvdx^2)

subs(reveq,collect(algsubs(eq,temp2),PP,simplify));

(-cos(theta(x, y, t))^4*alpha[1]+(1/2)*(2*alpha[1]+alpha[2]+alpha[3]-alpha[5]+alpha[6])*cos(theta(x, y, t))^2-(1/2)*alpha[2]+(1/2)*alpha[4]+(1/2)*alpha[5])*(dudy^2+dvdx^2)

Download somecoll.mw

If you actually wanted to "collect" that term within a modification of the original expression assigned to aa, then you could follow that up with either of,

  subs(reveq,collect(algsubs(eq,expand(aa)),PP,simplify));

or,

  subs(reveq,collect(algsubs(eq,temp1),PP,simplify))
   + simplify(aa-temp1);

This can be done in your Maple 18 simply by,

   convert([sol],rational)[]

 

You have an expression sequence assigned to sol, not a list or a set. By wrapping it in square backets you get [sol] as a list. This allows you to pass them all together, without any being misinterpreted as options to the command.

By prepending [] to the call you can turn the result from a list back into a mere expression sequence (if you so want...).

problem1_ac.mw

This issue is covered quite clearly on the Help page for topic if, in the section Nested Selection Statements. See also the Help page for topic printlevel.

I'll mention that the inner conditional code does indeed get executed. The effects you're seeing only relate to the display of the inner results.

These effects also cover such nesting involving do-loops.

A good place to start looking for details, when you have an issue with a particular command, would be the Help page for that command.

 

restart;

assume(y > 1);

expr[1] := exp(y*LambertW(ln(y)));
expr[2] := (ln(y)/LambertW(ln(y)))^y;
expr[3] := eval(x^(x^x), x = exp(LambertW(ln(y))));
expr[4] := eval(x^(x^x), x = ln(y)/LambertW(ln(y)));

exp(y*LambertW(ln(y)))

(ln(y)/LambertW(ln(y)))^y

(exp(LambertW(ln(y))))^((exp(LambertW(ln(y))))^(exp(LambertW(ln(y)))))

(ln(y)/LambertW(ln(y)))^((ln(y)/LambertW(ln(y)))^(ln(y)/LambertW(ln(y))))

simplify( expr[3] - expr[4] );

0

 

Another, with one extra step

 

simplify(combine( expr[3] - expr[1] ));

0

 

Progress of a kind

 

simplify( ln( expr[1]/expr[2] ) );

0

simplify( ln( combine( expr[3]/expr[2] ) ) );

0

Download LambW_simpl1.mw

You misspelled Distance as distance.

restart;

with(Student:-MultivariateCalculus):

A := [0, 0, 0]:
B := [c, 0, 0]:
C := [(-a^2 + b^2 + c^2)/(2*c),
      sqrt((a + b - c)*(a - b + c)*(-a + b + c)*(a + b + c))/(2*c), 0]:
S := [x, y, z]:

solve([Distance(S, A) = m, Distance(S, B) = n,
       Distance(S, C) = p], [x, y, z], explicit);

[[x = (1/2)*(c^2+m^2-n^2)/c, y = (1/2)*(a^2*c^2+a^2*m^2-a^2*n^2+b^2*c^2-b^2*m^2+b^2*n^2-c^4+c^2*m^2+c^2*n^2-2*c^2*p^2)/((-(a+b-c)*(a-b+c)*(a-b-c)*(a+b+c))^(1/2)*c), z = ((a^4-2*a^2*b^2-2*a^2*c^2+b^4-2*b^2*c^2+c^4)*(a^4*m^2+a^2*b^2*c^2-a^2*b^2*m^2-a^2*b^2*n^2-a^2*c^2*m^2-a^2*c^2*p^2+a^2*m^4-a^2*m^2*n^2-a^2*m^2*p^2+a^2*n^2*p^2+b^4*n^2-b^2*c^2*n^2-b^2*c^2*p^2-b^2*m^2*n^2+b^2*m^2*p^2+b^2*n^4-b^2*n^2*p^2+c^4*p^2+c^2*m^2*n^2-c^2*m^2*p^2-c^2*n^2*p^2+c^2*p^4))^(1/2)/(a^4-2*a^2*b^2-2*a^2*c^2+b^4-2*b^2*c^2+c^4)], [x = (1/2)*(c^2+m^2-n^2)/c, y = (1/2)*(a^2*c^2+a^2*m^2-a^2*n^2+b^2*c^2-b^2*m^2+b^2*n^2-c^4+c^2*m^2+c^2*n^2-2*c^2*p^2)/((-(a+b-c)*(a-b+c)*(a-b-c)*(a+b+c))^(1/2)*c), z = -((a^4-2*a^2*b^2-2*a^2*c^2+b^4-2*b^2*c^2+c^4)*(a^4*m^2+a^2*b^2*c^2-a^2*b^2*m^2-a^2*b^2*n^2-a^2*c^2*m^2-a^2*c^2*p^2+a^2*m^4-a^2*m^2*n^2-a^2*m^2*p^2+a^2*n^2*p^2+b^4*n^2-b^2*c^2*n^2-b^2*c^2*p^2-b^2*m^2*n^2+b^2*m^2*p^2+b^2*n^4-b^2*n^2*p^2+c^4*p^2+c^2*m^2*n^2-c^2*m^2*p^2-c^2*n^2*p^2+c^2*p^4))^(1/2)/(a^4-2*a^2*b^2-2*a^2*c^2+b^4-2*b^2*c^2+c^4)]]

Download distance_ex.mw

Is this the kind of effect you're after?

restart

with(ListTools):

Q := [15.59270850, 9.932905704, 5.445184045, 2.139179446, 0.];

[15.59270850, 9.932905704, 5.445184045, 2.139179446, 0.]

r := [5, 4, 3, 2, 1];

[5, 4, 3, 2, 1]

plot(r, Q);

revr, revQ := Reverse(r), Reverse(Q);

[1, 2, 3, 4, 5], [0., 2.139179446, 5.445184045, 9.932905704, 15.59270850]

plot(r, revQ, axis[1] = [tickmarks = [seq(r[i] = revr[i], i = 1 .. nops(r))]]);

Download plot_1_ac.mw

There are several variants on this methodology. I just gave one. (You don't necessarily need to construct revr. Instead you could refer to the reversed entries in the rhs of the tickmarks equation by indexing with a formula. And so on...)

I used Reverse after loading ListTools. Again, there are several other ways. Too many to mention. But the basic idea is to force the tickmarks.

ps. I gave one of the variants that is "simpler" because it relies on the special kind of r values you have. In fact for this special kind of r-values it could be done even more simply.

It's also possible to do it for more general r values (irregularly spaced, say), with a more exotic mapping. Let us know if you need that,

The idea behind that particular calling sequence is that you can efficiently re-use the created rtable (Array, Vector, etc). The relevant calls to Sample will populate the passed rtable, in-place.

This is more efficient than having Sample create new rtable containers each time, especially if you are going to do this many times.

restart

with(Statistics)

Define a random variable.

X := RandomVariable(Normal(0, 1))

Sample that random variable. We sample it 10 times and look at the output.

A := Sample(X, 10)

Vector[row](%id = 36893628369891418468)

The float rtable is defined with the sample number of elements as will be sampled.

tab1 := Array(1 .. 10, datatype = float[8])

Array(%id = 36893628369891408220)

The following acts in-place on tab1, populating it with new values.
Sample(X, tab1)

tab1

Array(%id = 36893628369891408220)

The following again acts in-place on tab1, populating it with new values.
Sample(X, tab1)

tab1

Array(%id = 36893628369891408220)

NULL

Download Sample_and_rtables.mw

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.

First 44 45 46 47 48 49 50 Last Page 46 of 336