## 28100 Reputation

17 years, 244 days

## See the Help page...

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.

## a little progress...

 > 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)));

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

Another, with one extra step

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

Progress of a kind

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

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

## Distance...

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);

## like this?...

Is this the kind of effect you're after?

 >
 >
 >

 >

 >

 >

 >

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,

## out...

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.

 Define a random variable. Sample that random variable. We sample it 10 times and look at the output. The float rtable is defined with the sample number of elements as will be sampled. The following acts in-place on tab1, populating it with new values. The following again acts in-place on tab1, populating it with new values.

## coupled...

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.

 >
 > kernelopts(version);

 >
 >
 >
 > 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;

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

 >

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

 >

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.

## like this?...

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):

 >
 >
 >

 >

 >

 >

 >

 >

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

 >

 >

 >

 >

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.

## method=trager...

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);

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

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

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

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

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

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

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.

## right...

Consider this counterexample, where x=-1.

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

 > simplify(ee);

 > simplify(ee) assuming x>=0;

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

 > simplify(r^3);

 > simplify( ( -1 )^3 );

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

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

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

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

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

## fsolve...

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

 > restart;
 > kernelopts(version);

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

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

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

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

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

## favorites...

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.

## geometry:-draw...

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.

 The following uses geometry:-draw draw(B) draw(B, color = blue, symbol = solidcircle)

## substitution...

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

## so many ways...

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

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

The next automatically simplifies to the previous...

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

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

 > n[1]^2+n[2]^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);

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

Alternatives...

 > DotProduct(n,n,conjugate=false);

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

 > n.n^%T;