Carl Love

## 26862 Reputation

11 years, 304 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

## Procedure-valued procedure...

@Hullzie16 The two-variable-function approach can achieve something much closer to what the OP wants by separating the two variables like this:

F:= a-> x-> a*x:
f:= F(3);

f := x -> 3*x

## You need known values at right boundary...

To use a shooting method in this case, you need known values at the right boundary (x=100), which you try to achieve by guessing initial conditions (D@@2)(f)(0), D(phi)(0), and D(theta)(0). You seem to be guessing values for x=100 rather than x=0.

Also, the differential order of this system is 7, so you need three guesses, not 4.

This Reply is not an attempt to correct the numerous other errors you've made. I just need to know 3 actual values at x=100 or x=infinity to proceed.

## Did you get the plot?...

@C_R Please let me know whether the issue that you had with my plotting command has been resolved.

## With the OP's code...

@C_R The only change that I made to the OP's code is that display command. For it to work, you need to use it within that original code:

```restart;
with(geometry);
with(plots);
_EnvHorizomtalName = 'x';
_EnvVerticalName = 'y';
_local(D);
line(delta, y = 1/3*x - 2, [x, y]);
line(deltap, y = (-1)/4*x + 1, [x, y]);
line(D, y = 3*x - 5, [x, y]);
point(S, 3, 0);
omega := Pi/3;
intersection(P, delta, D);
intersection(Pp, deltap, D);
projection(H, S, delta);
projection(K, S, deltap);
projection(M, S, D);
circle(c1, [H, K, M], 'centername' = O1);
display(
textplot(
[
[coordinates(S)[], "S"], [coordinates(P)[], "P"], [coordinates(H)[], "H"],
[coordinates(K)[], "K"], [coordinates(M)[], "M"]
], font = [times, bold, 16], align = [above, right]
),
draw([
delta(color = blue), deltap(color = blue), D(color = red), c1(color = black),
S(color = black, symbol = solidcircle, symbolsize = 16),
P(color = black, symbol = solidcircle, symbolsize = 16)
]),
scaling = constrained, axes = none, view = [-15 .. 15, -15 .. 15]
);```

## Just working with the given formulas...

@vv Thank you. Yes, I noticed those separation anomalies. My goal was only to translate the given formulas into concise Maple with altering them mathematically.

## Composition of simplifications...

@C_R You wrote:

• In the context of simplify I thought by defining a special procedure the flow of simplification steps could be controlled this way

`simplify(expr,Maple_proc,My_proc,Maple_proc)`

and by doing so several code lines could be saved.

Without loss of generality, I'll assume that your two Maple_procs represent different pre-defined `simplfiy/...` procedures, and I'll call them Maple_proc1 and Maple_proc2, respectively. Then what you want can be achieved in a single line of code as

`@`(`simplify/`||(Maple_proc2, My_proc, Maple_proc1))(expr)

Note the reversed order of the Maple_procs.

This doesn't address the issue of getting these procedures to handle equations.

## "Have a look"?...

Since you say "have a look", I assume that you intended either to attach a file or copy-and-paste some plaintext code. But it didn't get posted.

## Empty 'else' clause isn't an error...

@C_R This was just a red herring in the OP's code: An if statement with an empty else clause (or empty then clause) is not a syntax error, even if there is a semicolon. NULL is a valid expression, expressions can be used as statements, and the complete absence of non-white-space characters after certain keywords (at the moment, I can think of thenelsereturn, do, try, and finally) is interpreted as NULL.

But I do think that your idea about abs(v[i] - 1) being not what the OP intended is on the right track.

## Improved version...

@Carl Love I improved the code above to use what I consider to be cleaner syntax, to use standard spherical coordinates, to narrow the color ranges, and to add an orientation.

## evalb is redundant...

@janhardo In statements that require a Boolean condition (such as an if statement), wrapping the condition with evalb is redundant. So, for example, these two statements do exactly the same thing:

1. if A=B then 1 else 2 fi;
2. if evalb(A=B) then 1 else 2 fi;

Therefore, evalb cannot take the place of is.

Is there a reason that you don't want to use is?

## The essential thing is `is`...

@janhardo The essential difference between Axel's code and yours is not that he used D instead of diff, but that he used the is command instead of plain `=`.

## D in italics...

@Ronan Yes, I used `&D;` because is already used, and `&D;` prettyprints as (i.e,, italicized like a normal variable). Using local D doesn't give you the italics.

## Killing individual kernels from Task Man...

You wrote:

• Before killing a whole Maple session and potentially losing the last state of a worksheet it can pay off to wait and repeatedly interrupt an operation.

There's no need to wait. You can kill individual kernels from Windows Task Manager. This is effectively the same as getting "Kernel connection has been lost", so you still have a chance to save the worksheet, and it has no effect on the rest of your session. To do it, right click on the mserver.exe shown and select "End Task".

## a[0], b[0] not a[3], b[3]...

@dharr It took me a long time to figure out why you got 4 solutions, while I got 18. You added a[3] and b[3] as variables and removed a[0] and b[0].

 2 3 4 5 6 7 8 Last Page 4 of 693
﻿