dharr

Dr. David Harrington

9197 Reputation

22 Badges

21 years, 299 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

@salim-barzani 

In the first paper, eq 4.1 is confusing as I said, but even more so since 4.15 is different yet also gets substituted into 4.2 and afterwards eq 4.20 still has the exp part from eq 4.1. So I can't figure this out.

@salim-barzani Please provide a link to this paper.

Which is the first equation which is wrong. If it is just something with t, note that your T1, which I think is supposed to be Eq. 4.1, has epsilon^2*t/2 but Eq. 4.1 has epsilon^2*t^2/2. You also have function U(w*x-beta*t) there instead of just w*x-beta*t?

This looks correct to me; there is only one u, related to the content. If you look at ?sqrfree it says "u is the content(a,x) times a unit.".

@C_R Yes, it seems like a long way from eval(1/(3+2*sqrt(2))) to the usage above. I guess features keep getting added and the help doesn't keep up. I'm not even sure how I know this usage (more precisely "how I guessed this"); probably from some discussion on this forum.

@salim-barzani I have edited it to say that it was the [4,3,1] case. Here is how I understand what you asked for.

In your question you want to know how to solve all neural net cases. You gave

(1) a paper describing the method and solving Eq 1 for some specific neural networks [4,3,1] and [4,2,2,1] with specific functions.

(2) a worksheet t1.mw for Eq 1 the [4,3,1] case with the same activation functions as in the paper, which leads to an error.

(3) a worksheet t2-true-one.mw for Eq. 1 for the [4,2,2,1] case with the same functions as in the paper.

and the comment "t1 have problem about  first case of layer and t2 dont have problem".

I explained the error in t1.mw, which for some reason you did differently from t2-true-one. So you can now complete that case. In both these cases you used a different methodology before you started the neural net part, so you arrived at different solutions from in the paper.

In response you explained you have a generator for the neural network equation that can be supplied the the type of neural network and any desired functions.

I wanted to understand whether the paper method is somehow different from your method in the sense of what "term" means in "setting the coefficients of each term to zero". So I managed to replicate the paper solution for set 1 of the [4,3,1] case. So at this point you know how to solve Eq. 1 using neural networks, getting two types of solutions (your method in t2-true-one.mw and the paper method using Hirota transformations).

So now you are giving more papers and worksheets, which I am not going to read. I think you want to somehow find all cases. But the paper says "activation function which can be interpreted arbitrarily" (any function) and you already have a generator for the different types of neural network so as far as I can see you have everything you need.

If you are asking for some huge procedure that does everything, then the problem would need to be very carefully specified. Aside from the fact that there is a lot of work doing argument checking etc., I have been reluctant to make such procedures in the past for two reasons: (1) you jump between different types of equations, methodologies, numbers of parameters etc and so the problem description is insufficiently precise, and (2) I want to provide lines of code that are simple enough that you can understand them and modify them yourself (my background as an educator I guess).

You should not use =0 if you are going to use numer(normal(...)) or collect etc. That was the main error. I didn't attempt to follow the logic, but coeff doesn't work on a set.

t1.mw

@sand15 I was aware of the ambiguity in natural numbers. In New Zealand we learnt that it started with 1.
Note that with 3 sign changes, the number of positive solutions is 3 or 1 (multiples of two less than the number of sign changes is also possible).

But the cubic is probably the way to go; large integer solutions may come from finding integer/rational points on elliptic curves.

@sand15 I assume by natural numbers are meant {1,2,3,...}, i.e., not including zero.

@Alfred_F @vv So the case I chose is not a Holditch curve, in the notation of the Monterde and Rochera paper. But empirically it still seems to have area/ab = Pi. 

@acer Yes, missed that and I misread cos(x),sin(x*y)  as cos(x)*sin(x*y) and was focused on the issue with the parameter part of the dsolve procedure. It would be easier if the OP uploaded a worksheet.

[Edit: it is an evaluation problem, but my solution is for a regular, not parametric plot.[

The problem is the x in the plot(h(7.7,x),..) call. When you call plot, h(7.7,x) is evaluated, and the result is the error message because the parameter x does not have a value. The solution is to add the line

if not [k,x]::[numeric,numeric] then return 'procname'(_passed) end if;

at the beginning of h so that the call returns unevaluated if it does not get numeric values of k and x, and the procedure from dsolve is never invoked. Later internally within plot, it gets numeric values of x that are plotted.

The reason that f does not lead to the same problem is that its evaluation gives an expression in x that does not lead to an error.

@Alfred_F I was working on an animation. Still a bit buggy for some curves; the code pushes one end of the chord (with the magenta dot), and solves for the other end, but there are two solutions for the other end and it sometimes jumps from one to the other or can't solve.

There are discontinuities in this case but area/ab still seems to be Pi (3.135453491). The file was too large to load with output. (I should not include the original curve in each frame of the animation.)

Curve2.mw

@vv That's helpful. I was puzzling over what "the point in which the chord intersects its consecutive position" meant.

@C_R Not sure it is related, but here are a couple more puzzles with ditto.

restart

interface(version)

`Standard Worksheet Interface, Maple 2026.1, Windows 11, April 28 2026 Build ID 2011354`

a+b; %-op(2, %)

Error, invalid sum/difference

"a+b; %-op(2,`%`);"

Converted to 1D

 a+b; `%`-op(2,`%`);

a+b

a

a; b; %-`%%`

Error, invalid sum/difference

"a;b; %-`%%`;"

Converted to 1-D

a;b; `%`-`%%`; ;

a

b

b-a

 

 

Download ditto.mw

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