LeeHoYeung

Mr. Ho Yeung Lee

535 Reputation

10 Badges

12 years, 230 days

Social Networks and Content at Maplesoft.com

Seldom to ask question after retired math hobby Welcome August, February, July, May born girl And waited for her email to mavio@protonmail.com

MaplePrimes Activity


These are replies submitted by LeeHoYeung

@Christopher2222 

how to do the mesh on the image it read?

with the following library? 

http://www-math.mit.edu/~persson/mesh/persson03mesh.pdf

http://www-math.mit.edu/~gs/papers/papers.html

  1. A simple mesh generator in MATLAB, with Per-Olof Persson, SIAM Review, 46 (2004). 329-345.

@taro 

no , I do not mean this,

if a question only give part of variety

how to find a complete variety from incomplete variety

is there any dependent or independent checking function?

@Kitonum 

hi kitonum,

when there are two plus a+b+c

it return a 3 parameters function 

how to be func1(func1(a,b),c) 

two parameters only instead of func1(a,b,c)?

@taro 

prefix command is in previous one or two questions which I asked before 

@Kitonum 

Hi Kitonum,

i still have something to ask, when treat minus sign, 

it return error Error, (in Prefix) type ``-`` does not exist

Prefix:=proc(Expr)
if type(Expr, `*`) then return zipstar(Prefix~([op(Expr)])[ ]) else
if type(Expr, `+`) then return zipplus(Prefix~([op(Expr)])[ ]) else
if type(Expr, `^`) then return func3(Prefix~([op(Expr)])[ ]) else
if type(Expr, `-`) then return Expr else
Expr  fi; fi; fi; fi;
end proc:
Prefix(-u1*u3+u1*x2);
Prefix(a^3*b+c);
Error, (in Prefix) type ``-`` does not exist
 

@Kitonum 

very excellent. Thank you.

@Kitonum 

But this is only hard coded,

i would like to automate this and apply on large amount of equations

i guess it is like prefix but not * and +

because I define custom functions func1 and func2

just input the equation and then output the transformed equation

@AmusingYeti 

but, not only coordinate of B and there is also coordinate of E which is electric field

so there are at least six variables are unknown

how to plot when there is coordinate of E field?

is there an example to plot this?

do it need to solve first?

if using Riemann to solve it, how to do?

@AmusingYeti 

there are four equation in maxwell equations

such as

curl B - 1/c*diff(E,t) = 4*pi/c j

if I set B as (B1,B2,B3) respect to X1,x2,x3

is it the expected to specify ?

which need to specify?

and what are they corresponding to physical thing

 

@tomleslie 

if change to back propagation, I change plus to minus in b and weight equation but do not work after set initial b and initial weight to value  10 to let it minus 

how to change to back propagation ?

i feel neural network is like mimic an existing system from input and output

which part or where do intelligence come from?

@tomleslie 

i edit functions and add extra function MM for MIMO, 

#do not know whether MM is correct or not, i just do for each set of target independently and then concatenate them.
and then test it , it can output result for one to one and many to one, 

but it can not output result for one to many 

is it correct implementation of supervied learning of neural network for MIMO?

 

metara := proc(pp,meaght,bb,mapp,deep)
if deep > 0 then
 pp2 := metara([seq(pp[i], i = 1 .. nops(pp))],meaght,bb,mapp,deep-1):
 mp := zip((x,y) -> x*y,pp2,meaght):
 mpsam := sum(mp[m],m=1..nops(pp2)):
 mpb := [seq(0, i = 1 .. nops(pp2))]:
 for ii from 1 to nops(bb) do
  mpb[ii] := evalf(mpsam + bb[ii]);
 od:
 pa := [seq(0, i = 1 .. nops(pp2))]:
 for ii from 1 to nops(bb) do
  pa[ii] := evalf(mapp[deep](mpb[ii])):
 od:
 return pa:
else
 return pp:
end if:
end proc:

perceptronrule1 := proc(p, t1, meaght1, b1, checksum, mapp)
 meaght3 := meaght1:
 b3 := b1:
 checksum2 := checksum;
 print(p[1]):
 while sum(checksum2[jj], jj=1..nops(p)) <> nops(p) do
  #print("sum(checksum2[jj], jj=1..nops(p))");
  #print(sum(checksum2[jj], jj=1..nops(p)));
  for ii from 1 to nops(p) do
   #print("metara(p[ii],meaght3,b3,mapp,1)");
   #print("p[ii]");
   #print(p[ii]);
   #print("b3");
   #print(b3);
   #print("meaght3");
   #print(meaght3);
   #print(metara(p[ii],meaght3,b3,mapp,1));
   #print("t1[ii]");
   #print(t1[ii]);
   e := zipminus(t1[ii], metara(p[ii],meaght3,b3,mapp,1));
   #print("e");
   #print(e);
   meaght2 := meaght3 + zipstar(e,p[ii]);
   #print("meaght2");
   #print(meaght2);
   #print("meaght3");
   #print(meaght3);
   #print("b3");
   #print(b3);
   b2 := b3 + e;
   #print("b2");
   #print(b2);
   #print("b3");
   #print(b3);
   #print("checksum2");
   #print(checksum2);
   diff1 := zipminus(meaght2, meaght3):
   diff2 := zipminus(b2, b3):
   if sum(diff1[m],m=1..nops(diff1)) = 0 and sum(diff2[m],m=1..nops(diff2)) = 0 then
    checksum2[ii] := 1:
   else
    checksum2[ii] := 0:
    b3 := b2:
    meaght3 := meaght2:
   end if:
  od:
 od:
 return [meaght3, b3, checksum];
end proc:

MM := proc(p3, t3, meaght3, b3, checksum3, mapp3)
result := []:
for kk from 1 to nops(t3[1]) do
 t5 := [seq([seq(t3[jj][kk], ii=1..nops(t3[1]))],jj=1..nops(t3))];
 r3 := perceptronrule1(p3, t5, meaght3, b3, checksum3, mapp3);
 result := [op(result), [r3[1], r3[2]]];
od:
return result;
end proc:

ppp := [[0,0],[0,1],[1,0],[1,1]]:
check1 := [seq(0,ii=1..nops(ppp))];
ttt1 := [[0,0],[1,0],[1,0],[1,1]]:
mmmeaght1 := [seq(0,ii=1..nops(ppp[1]))]:
bbb1 := [seq(0,ii=1..nops(ppp[1]))]:
emap := [(x) -> if x < 0 then 0 else 1 end if, (x) -> evalf(1/(1+exp(x)))]:
#trace(perceptronrule1);
MM(ppp, ttt1, mmmeaght1, bbb1, check1, emap);

#my testing for one to one
#after testing, it loop a very long time and not stop
ppp := [[0,0,0,1],[0,0,1,0],[0,1,0,0],[1,0,0,0]]:
check1 := [seq(0,ii=1..nops(ppp))];
ttt1 := [[0,0,0,1],[0,0,1,0],[0,1,0,0],[1,0,0,0]]:
mmmeaght1 := [seq(0,ii=1..nops(ppp[1]))]:
bbb1 := [seq(0,ii=1..nops(ppp[1]))]:
emap := [(x) -> if x < 0 then 0 else 1 end if, (x) -> evalf(1/(1+exp(x)))]:
#trace(perceptronrule1);
MM(ppp, ttt1, mmmeaght1, bbb1, check1, emap);

#my testing for many to one
#after testing, it loop a very long time and not stop
ppp := [[1,1,0,0],[0,1,1,0],[0,1,0,1]]:
check1 := [seq(0,ii=1..nops(ppp))];
ttt1 := [[0,1,0,0],[0,1,0,0],[0,0,0,1]]:
mmmeaght1 := [seq(0,ii=1..nops(ppp[1]))]:
bbb1 := [seq(0,ii=1..nops(ppp[1]))]:
emap := [(x) -> if x < 0 then 0 else 1 end if, (x) -> evalf(1/(1+exp(x)))]:
#trace(perceptronrule1);
MM(ppp, ttt1, mmmeaght1, bbb1, check1, emap);

#my testing for one to many
ppp := [[0,1,0,0],[0,1,0,0],[0,0,0,1]]:
check1 := [seq(0,ii=1..nops(ppp))];
ttt1 := [[1,1,0,0],[0,1,1,0],[0,1,0,1]]:
mmmeaght1 := [seq(0,ii=1..nops(ppp[1]))]:
bbb1 := [seq(0,ii=1..nops(ppp[1]))]:
emap := [(x) -> if x < 0 then 0 else 1 end if, (x) -> evalf(1/(1+exp(x)))]:
#trace(perceptronrule1);
MM(ppp, ttt1, mmmeaght1, bbb1, check1, emap);

@tomleslie 

dsolve is not a Async

I feel sample or elapsed can not be applied in my code

is it possible set dsolve a async

@Preben Alsholm 

i search timer in help file then use this example. but elapsed can only be called one time, 

Clock := proc()
    module()
        export    start, halt, now, reset, sample, elapsed;
        local     checkpoint, running;
        description "a clock object";

        # an internal state variable; assigned when clock is running.
        checkpoint := 'checkpoint';    

        # Test whether the clock is running at the point of call.
        running := proc()
            not type( checkpoint, 'symbol' )
        end proc;

        # Return the current time
        now := () -> iolib( 25 );

        # Start the clock as a timer
        start := proc()
            checkpoint := now()
        end proc;

        # Reset a clock that is already running.
        reset := proc()
            if running() then
                checkpoint := now()
            else
                error "clock is not running"
            end if
        end proc;

        # Stop the clock (as a stopwatch).
        halt := proc()
            checkpoint := 'checkpoint'
        end proc;

        # Sample the current running time since the clock
        # was last started or reset.
        sample := proc()
            if type( checkpoint, 'symbol' ) then
                error "clock is not running"
            else
                now() - checkpoint
            end if
        end proc;

        # Return the time (in seconds) that has elapsed since
        # the clock was started.
        elapsed := proc()
            local t;
            t := sample();
            halt();
            t
        end proc;
    end module
end proc:
dummyfunction := proc(param1, characteristic):
sol := dsolve(sys,hello);
clock := Clock():
clock:-now();
clock:-start():
while not(rhs(sol[1][1])/rhs(sol[3][1]) = 1 or rhs(sol[1][1])/rhs(sol[3][1]) = -1) and clock:-elapsed() <= 5 do
sol := dsolve(sys,hello);
if length(convert(sol,string)) > previouslength then
 numberofincrease := numberofincrease + 1;
end if:
previouslength := length(convert(sol,string));
od;
return [numberofincrease, "max=3", length(convert(sol,string)), characteristic2, rhs(sol[1][1])];
end proc:
 

@Christopher2222 

for example, a typhoon enter the circle field

@Kitonum 

i mean that there assumed another object or system which enter into this original circle flow field,

assumed function f is extra object,

i use +f and -f to first equation and second equation , but circle field disappear 

First 12 13 14 15 16 17 18 Last Page 14 of 45