MapleMathMatt

277 Reputation

2 Badges

1 years, 334 days

MaplePrimes Activity


These are replies submitted by MapleMathMatt

@thiru4565 

You can generate and export a Matrix of points like this:

Fxp := unapply( F(x), [x,p] ):
Gxp := unapply( G(x), [x,p] ):
XF := Matrix( map( x -> [x,Fxp(x,1)], [ seq( 0..5, 0.2 ) ] ) );
Export( "F-Points.csv", XF );

I'm not clear on what you are asking in Doubt 2, but I believe that the above can be adapted for it.

Hi @thiru4565,

Does this produce what you're after?

restart;

de0 := {
    (1-p)*(diff(f(x),x,x,x))+p*(diff(f(x),x,x,x)+(1/2)*f(x)*(diff(f(x),x,x))),
    (1-p)*(diff(g(x),x$2))/Pr+p*((diff(g(x),x$2))/Pr+(1/2)*f(x)*(diff(g(x),x)))
};

ibvc0 := {f(0),(D(f))(0),(D(f))(5)-1,g(0)-1,g(5)};
n:=5;

F := unapply( add(b[k](x)*p^k,k=0..n), x ):
G := unapply( add(c[k](x)*p^k,k=0..n), x ):

de := map( series, eval( de0, {f=F,g=G} ), p=0, n+1 ):

for k from 0 to n do

    if k = 0 then
        ibvc := expand( eval[recurse]( ibvc0, {f=F,g=G,p=0} ) ):
    else
        ibvc := { b[k](0), D(b[k])(0), (D@@2)(b[k])(0), c[k](0), D(c[k])(0) }:
    end if:

    sys := simplify( map( coeff, de, p, k ) ) union ibvc:
    soln := dsolve( sys ):
    
    b[k] := unapply( eval( b[k](x), soln ), x ):
    c[k] := unapply( eval( c[k](x), soln ), x ):    

end do:

'F(x)' = F(x);
'G(x)' = G(x);

@thiru4565: Could you upload your worksheet in a reply here? That way, others can offer suggestions as well.

Hi @thiru4565,

The function F(x) implicitly depends on parameter p, but you can use eval(). For instance:

plot( eval( [ F(x), diff( F(x), x ) ], p=0.1 ), x=0..5, color=[blue,red] );

Hi @David1,

Maybe you need to set the environment variable MATLAB_SYMBOLIC to maple. Try starting Matlab by executing the following from a Command Prompt:

cd "C:\Program Files\MATLAB\R2017a\bin"
set MATLAB_SYMBOLIC=maple
matlab.exe %*

When in Matlab, does

maple( '1' )

return 1 or an error? If it works, you can create a permanent environment variable in the Advanced System Settings of Windows.

 

 

@Carl Love 

Here's an example, where one equation is a symbolic multiple of the other:

f := a * x = b;
g := a * x - b;

EquivEQ( f, g ); # true
EquivEQ( f, c * g ); # false
EquivEQ( f, c * g, 'params'={c} ); # true

@Venkat Subramanian

Sorry, I was confused for a second there. (Classic doesn't use Java, so I don't think the Java Access Bridge can have any effect.)

 

Do you have any screen readers like JAWS or NVDA installed? If so, are you able to run Maple and save worksheets when the reader is disabled?

@Venkat Subramanian

The "God Mode" folder shouldn't affect Classic, since Classic doesn't use Java. The problem may be that you need to enable the Java Access Bridge. To do this, you can insert the line

jaccess=true

in the

C:\Program Files\Maple 2017\bin.X86_64_WINDOWS\launch.ini

file. (The path assumes 64-bit Maple 2017 and 64-bit Windows.)

 

@ngon 

I was having a similar problem with Maple, and a Java crash "hs_log_pid" log file was saved on my desktop. This file referenced "EXCEPTION_ACCESS_VIOLATION" and "msvcr100.dll+0x36adf". After some digging, it turned out that "God Mode" produced similar error messages in other programs, so I tried deleting the "God Mode" folder on my desktop, and then Maple ran and saved files just fine.

I believe that the problem was either caused by or related to the JRE that ships with Maple, and using the latest update of Java 8 no longer produces the error.

 

@Earl 

The map() command is useful for distributing a function/procedure over a single, specified data container, with the other arguments fixed. For instance, for function phi(x,y,z):

map[2]( phi, a, [b,c], d ); # [ phi(a,b,d), phi(a,c,d) ]

with the index telling Maple which argument to distribute over. Note map=map[1] and map2=map[2].

The operator ~, though, operates element-wise. For phi(x,y,z) again:

phi~( [a,b], c, [d,e] ); # [ phi(a,c,d), phi(b,c,e) ]

Here, the distribution occurs in unison over the two lists (which need to be of the same size).

Of course, the results of map() and ~ may coincide:

phi~( [a,b], c, d );
map( phi, [a,b], c, d );

For your worksheet, using map~() applies map() element-wise, so (see below) X is computed as Y, and Y is computed as Z, and P treats each Ai and Bi (i=1..4) as lists (hence the subscripts):

X := map~( P, [A1, A2, A3, A4], [B1, B2, B3, B4] );
Y := [ map(P,A1,B1), map(P,A2,B2), map(P,A3,B3), map(P,A4,B4) ];
Z := [ P(A1,B1), P(A2,B2), P(A3,B3), P(A4,B4) ];
is( X = Y and Y = Z ); # true

@rlopez 

Thanks, Robert. The "&." was indeed a typo, it should be "%.".

@nunavutpanther:

Sorry about that. It looks like Maple 2015.2 with Physics2015.mla (from the link I gave earlier) is needed for my code to run. Unfortunately, even with Physics18.mla, Maple 18.02 will throw an error.

@nunavutpanther 

I was using Maple 2017, but I get the same error when I try Maple 18, so, depending on your version of Maple, you may be able to update the package by downloading it from Maplesoft's website:

https://www.maplesoft.com/products/maple/features/physicsresearch.aspx

Page 1 of 1