Preben Alsholm

13115 Reputation

22 Badges

18 years, 305 days

MaplePrimes Activity

These are replies submitted by Preben Alsholm

Could it be a license problem?

@Carl Love Thanks for the suggestion. It certainly couldn't hurt.

@Carl Love I'm happy to see that the post now appears under questions.

@xavier I turned your post into a question. Initially after that it appeared to have disappeared, but I found by searching you (xavier) under Users.

This morning I read the post "décomposition d'un entier en somme d'entiers et partage d'un ensemble non vide en u parties non vides" by the user xavier. There was also a comment on that post by xavier.
It seemed to me that the post was really a question. So I turned it into a question. Initially on my screen it said  Question: ---title---.
But it now seems to be gone. At this time it still appears as the last post in the menu.

Added about an hour later: I found the post, now as a question by searching the user xavier.

@Christopher2222 Are you sure that sursumcorda didn't delete his own comment?

Yesterday I saw under "Active Conversations" the following:

Initially I didn't check the date, but just wrote a comment, which stated that there was no tilde problem in Maple 2023.
When I later returned to the link I saw that the question was posed in January 2006, i.e. 17 years ago, and that no responses were added later than that time. Thus my comment was totally irrelevant, so I deleted it.

I'm not suggesting that sursumcorda's comment was irrelevant. Clearly it was very relevant.

Had anybody responded to my comment on these old tilde problems I wouldn't have deleted my comment.

@Christopher2222 Thanks for reminding me of Map.

In your case you could use it like this:

a := [[1.2, 4.3], [3.2, 5.3]];

I prefer, however, the way given in my answer.

@felixiao I couldn't find out what was wrong; everything looked fine.
Therefore I copied the whole code and put it in a text editor (actually Notepad++).
In there I couldn't see any problem either, but I copied the code planted there and put it in a new worksheet in Maple.

Save it as the .mw file:

### Note added later: I did this in Maple2023.1, but I also tried in the much older Maple 12. The problem was the same there. For the remedy this time I used the Notepad that comes with Windows.


The plot looks like this:

@vv PolynomialSystem and solve both work with V as a list in Maple 12, but not in Maple 2021.

@Carl Love The matrices that are being inverted resulting in H5 and H7 and their determinants:

H51:=Matrix([[G11, G12], [G21, G22]]); ## ~H5
LinearAlgebra:-Determinant(H51);  ## 0. + (9.2517792695382088910002830954*10^(-32))*I
H71:=Matrix([[Z11, Z12], [Z21, Z22]]);   ## ~H7
LinearAlgebra:-Determinant(H71);  ## 0. - (1.89398211168871707929210978553*10^(-30))*I

Inverting the first matrix H51 results in the error. For the second we get in shortened form:

## Result:
## [[1.1548*10^16 - (1.3826*10^16)*I, -6.7969*10^15 + (8.1376*10^15)*I], [0. - (1.8014*10^16)*I, 0.15598 + (1.0603*10^16)*I]]

@felixiao I copied the code and removed evalm.

I got this:

@felixiao Could you please upload a worksheet: Use the fat green up-arrow in the editor.

You seem to have given us all the code in your question, but I tried copying that and run it (without any evalm).
There were several errors; maybe do the copying and pasting.
So please upload the worksheet.

@Tamour_Zubair It is understandable to me that you want to know about the basics of the numerical methods used to solve odes. But I would leave the rest to the expert(s), who wrote the code for (in this case) Maple's dsolve/numeric. The implementation is superb.
If you see going further as a challenge then OK. Go ahead.

@Carl Love and @Tamour_Zubair

Using the corrections mentioned by Carl I adjusted the code in the worksheet attached.
I made tolerance an optional keyword parameter. The result is returned as a Matrix whose first and second columns consist  of the t and y values, respectively.

### Since the first version I added another version, which in my view is better.
The old one remains and is at the bottom.
the new version doesn't  use lists and allows for use with odeplot.

@Tamour_Zubair The formal parameters used in a procedure cannot be changed inside a procedure:
Let us take a very simple example:

p:=proc(h) h:=h/2 end proc;

The formal parameter in the procedure p is h. When you apply p to 8 as in p(8), the first that happens is that h is replaced all over the body of the procedure by the number  8. So you have the nonsens assignment 8:=4.
Thus the error message that fortunately reveals the error.
The solution could be this revised version:

p:=proc(h1) local h;
end proc;
p(8); # 4

This you can do in RKF45 where the same happens.

RKF45 := proc(f, y0, t0, tn, h1) local k1, k2, k3, k4, k5, k6, y, t, Ynext, h_new, tol, ttt1,h; 
##The rest unchanged
end proc;

You now have a new problem, however. The computation appears to take forever.

Who wrote the code?

1 2 3 4 5 6 7 Last Page 1 of 220