MaplePrimes Questions

  restart;

  local gamma:
  local GAMMA:

  odeSystem:= [ (1 + GAMMA)*diff(f(eta), eta$4) - S*(eta*diff(f(eta), eta$3) + 3*diff(f(eta), eta$2)
                +
                diff(f(eta), eta)*diff(f(eta), eta$2) - f(eta)*diff(f(eta), eta$3))
                -
                GAMMA*delta(2*diff(f(eta), eta$2)*diff(f(eta), eta$3)^2 + diff(f(eta), eta$2)^2*diff(f(eta), eta$4))
                -
                M^2*diff(f(eta), eta$2) = 0,

                (1 + (4*R)/3)*diff(theta(eta), eta$2) + Pr*S*(f(eta)*diff(theta(eta), eta)
                -
                eta*diff(theta(eta), eta) + Q*theta(eta)) = 0,

                diff(phi(eta), eta$2) + Sc*S*(f(eta)*diff(phi(eta), eta)
                -
                eta*diff(phi(eta), eta)) - Sc*gamma*phi(eta) = 0
              ];

  params:= [ S = 0.5, GAMMA = 0.1, delta = 0.1, gamma = 0.1, M = 1,
             Pr = 1, Ec = 0.2, Sc = 0.6, R = 1, Q = 1
           ];
  bcs :=[ f(0) = 0, (D@@2)(f)(0) = 0, f(1) = 1, D(f)(1) = 0, D(theta)(0) = 0,
          theta(1) = 1, phi(1) = 1, D(phi)(0) = 0
        ];

how to solve the equations by finite element method

Please check: Finding_Chi_Version1.mw

My end goal is to find the following three expressions:

chi_1 := collect(X_A,[nnu[1],nnu[2]]);

chi_2 := collect(X_B,[nnu[1],nnu[2]]);

chi_3 := collect(X_C,[nnu[1],nnu[2]]);

I expect these three expressions to be linear combinations of random variables nu[1] (nnu[1]) and nu[2] (nnu[2]).

While calling solve(), I encounter this error:

Error, (in assuming) when calling 'SolveTools:-Engine:-Dispatch'. Received: 'badly formed input to solve: not fully algebraic'

What is exactly the issue here? If it can help you answer my doubt, that argmin expression I defined is composed by conditional means and variances which I computed as in here: conditional_distributions_Version1.mw

The two formulas I am trying to implement in Maple are conditional distribution of a multivariate normal distributionAm I already doing any mistake in conditional_distributions_Version1.mw? An alternative interpretation of mine for these two formulas is: conditional_distributions_Version2.mw. Please check the light-blue-highlighted differences in the conditional variance calculation. This alternative interpretation leads to Finding_Chi_Version2.mw, which I also can't solve() (solver stuck in "evaluating") but at least I don't get the error mentioned above...

I am a bit lost to be honest: Is Finding_Chi_Version1 or Finding_Chi_Version2 the correct interpretation? 

Thanks!

Hi

Can anyone help me with this problem, i need maple to solve 8 non linear equations with 8 unknowns. Ive searched the entire internet, and this is what ive scripted so far. However there seems to be a problem with the solve command.

Ive copied the code beneath and posted the maple file aswell

Script:

restart;
g := 9.82;
p := 999.7;
u := 1.307*10^(-3);

F1 := 18 = x__1^2/(2*g) + x__2;

F2 := x__2 = x__3*13/0.1*x__4^2/(2*g) + x__5*35/0.05*x__1^2/(2*g) + x__6*x__4^2/(2*g) + x__7*x__1^2/(2*g);

F3 := 0.1*p*x__4/u = 0.1*p*x__4/u;

F4 := 0.05*p*x__1/u = 0.05*p*x__1/u;

F5 := 1/sqrt(x__3) = -2*log*2.51/(F3*sqrt(x__3));

F6 := 1/sqrt(x__5) = -2*log*2.51/(F4*sqrt(x__5));

F7 := x__4 = 0.05/0.1*x__1;

F8 := x__8 = x__1*Pi*0.05^2/2;
 

solve({F1, F2, F3, F4, F5, F6, F7, F8}, [x__1, x__2, x__3, x__4, x__5, x__6, x__7, x__8]);
Error, invalid input: solve expects its 1st argument, eqs, to be of type {`and`, `not`, `or`, algebraic, relation(algebraic), ({list, set})({`and`, `not`, `or`, algebraic, relation(algebraic)})}, but received {18 = 0.5091649695e-1*x__1^2+x__2, x__2 = 6.619144604*x__3*x__4^2+35.64154786*x__5*x__1^2+0.5091649695e-1*x__6*x__4^2+0.5091649695e-1*x__7*x__1^2, x__4 = .5000000000*x__1, x__8 = 0.3926990818e-2*x__1, 1/x__3^(1/2) = (-0.6563108934e-4*log/(x__3^(1/2)*x__4) = -0.6563108934e-4*log/(x__3^(1/2)*x__4)), 1/x__5^(1/2) = (-0.1312621786e-3*log/(x__5^(1/2)*x__1) = -0.1312621786e-3*log/(x__5^(1/2)*x__1)), 38244.07039*x__1 = 38244.07039*x__1, 76488.14078*x__4 = 76488.14078*x__4}
 

Give a list of Graphs say G now how to write a function to MakeUnique the list that is improve Isomophic graphs duplicate only.

And to get a list which tells which tell which graphs where Isomophic to which one's for my by the index position of the graph in the list G of graphs.

Writing For loops , checking each are which are Isomorphic and finding them is ok.

Looking for a simple code.

If a polynomial is irreducible, you can use GroupTheory:-GaloisGroup or galois to compute its polynomial, for example:

G := GroupTheory:-GaloisGroup(x^5 - x + 1, x)

But what if polynomials are reducible? Such as x^5-x+15. How to compute its Galois group by maple? There are some examples to check at the end of this article

Dear all

How can I determine a positive constant M such that the following inequality hold for any positive values of a, b,c. 

More precisley, I determine M such that  f(a,b,c) greater or equal M a^2 

The constant M is a positive constant depend only on alpha 

find_positive_constant_M.mw

thank you for your help 

Hi all,

I'm trying to plot the regions of a cube [0,1]x[0,1]x[0,1] that are defined by two inequalities 

0<=x<=y<=z<=1

I tried the following but the result is not satisfying :

with(plots):
G1 := implicitplot3d(x = y, x = 0 .. 1, y = 0 .. 1, z = 0 .. 1, style = surface)

G2 := implicitplot3d(z = y, x = 0 .. 1, y = 0 .. 1, z = 0 .. 1, style = surface)

display({G1, G2})

Thank you for your help.

Dear all

I would like to compute Hardy−Littlewood maximal function : we use polar coordinate for a radial function  and then evalaute integral with respect the radius r 

Hardy_maximal_function.mw

Thank you for your help 


u := c1*BesselK(0, alpha1*r) + c2*BesselI(0, alpha1*r) + c3*BesselK(0, alpha2*r) + c4*BesselI(0, alpha2*r) - A1*k^2*(k^2 - (-alpha^2*j*s + 4*c*s)/c)*BesselK(0, k*r)/((-alpha1^2 + k^2)*(-alpha2^2 + k^2)) - B1*k^2*(k^2 - (-alpha^2*j*s + 4*c*s)/c)*BesselI(0, k*r)/((-alpha1^2 + k^2)*(-alpha2^2 + k^2)) + ur*(-alpha^2*j*s + 4*c*s)/(c*(1 + c));

w := (-1 - c)/(2*s*(4.*c - alpha^2*j))*collect(diff(diff(r*diff(u, r), r)/r, r) + (alpha^2 - 4*c*s)*diff(u, r)/(1 + c) - A1*k^3*BesselK(1, k*r) + B1*k^3*BesselI(1, k*r), [c1, c2, c3, c4], factor);

om := (-1)/2*diff(u, r)/r;

fn1 := collect(simplify(subs(subs(r = 1, u))), [c1, c2, c3, c4], factor);
fn2 := collect(simplify(subs(subs(r = sigma, u))), [c1, c2, c3, c4], factor);
fn3 := collect(simplify(subs(r = 1, w)), [c1, c2, c3, c4], factor);
fn4 := collect(simplify(subs(r = sigma, w)), [c1, c2, c3, c4], factor);
soln := simplify(solve({fn1 = 0, fn2 = 0, fn3 = 0, fn4 = 0}, {c1, c2, c3, c4}));

I was translating some code from Mathematica to Maple. Why MmaTranslator does not know about Mathematica's CubeRoot function? This was added in 2012 (more than 11 years ago).

Is this known? How could one teach Maple's MmaTranslator to convert CubeRoot[x] to surd(x,3)? Is it possible to manually add missing translations to this package? Otherwise I would have to manually edit lots of code and do this myself each time.

 

restart; 
with(MmaTranslator);
FromMma(`CubeRoot[9]`);

Gives CubeRoot(9) it should be surd(9, 3)

Version 2023 on windows 10

The Dominating set defination and Minimal dominating set definations given below

Code to generate the above.

A Function  F such that given the Graph G and vertex v as input the function should return me the number  of minimal dominating sets in the graph G contating the vertex v.

The logic to code seems to be above me Kind help some one please.

As manually doing is not that easy kind help.

I will surely acknowlege,

Kind help

We can read all the graphs in a file at once, or we can use an iterative approach. But can I specify a certain number of lines to read? 

with(GraphTheory):
g:=ImportGraph("E:/5cc3free.txt", graph6, output=list)

The contents of 5cc3free.txt are as follows (all 5-vertex C_3 free connected graphs).  There are 6 lines.

D?{
D@s
DBw
DFw
DDW
DqK

The reason for wanting this kind of operation is that sometimes there are tens of thousands of graphs stored in a single file, and I want to read them in batches. For example, I want to extract the graph data from lines 1-2, 3-4, and 5-6 in batches. How can I accomplish this?

In the previous example, a small dataset was used for demonstration purposes. In the following example, which involves all 8-vertex connected graphs (see the attachment graph8c.txt), I want to extract the graphs from lines 200-300. 

I found that readline always starts reading from the first line of a file, so the efficiency may not be very high.

For example - I have a for loop acting on a Matrix

a:=Matrix(20,20,rand(0..1.)

for i from 1 to 20 do
  for j from 1 to 20 do
    if a[i,j]<0.2 then a[i,j]:=0 end if:
  end do:
end do:

Is there an equivalent sequence loop?  I tried to set up a double seq to set the values in the matrix but this fails

seq(seq(`if`(a[i,j]<0.2,a[i,j]:=0,a[i,j]),i=1..20),j=1..20)

I have list of lists I looking to Shuffle the entire List of lists in a very very non-sequencial manner everthing thing fully shuffled.

I tried but I am unable to find the right way.

Attached a code I tried

Code like below

toy_shuffle.mw

First 87 88 89 90 91 92 93 Last Page 89 of 2308