MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

Hi All, 

I'm using the Physics package, which enables GR calculations, ie defining metrics and tensor algebra. 

Was just curious if it were possible to add a perturbation to the metric when calculating Ricci and Christoffels. 

I would like something like 

g_[] = g1_[mu,nu] + h[mu,nu] 

And then do a calculation like, 

Ricci[]. 

 

I know this would be possible if I define everything and re-write the calculations for calculating Ricci, i.e

Define(g1[mu,nu], h[mu,nu]); 

and the proceed with GR calculations to find Ricci, however was hoping there was an easier way to do this. 

Any help is appreciated. 

Thanks guys. 

Good evening all,

How can I plot a straightline with points 

LogAt = - 0.097,  -0.20, -0.22, -0.25, -0.30 ,-0.40, -0.45, -1.01 and

t = 0, 20, 40, 60, 80, 100, 120, 140

Where LogA[t] on y-axis and t on x-axis. 

I have try this before . 

plot([[0,-0.097], [20,-0.20], [40,-0.22], [60,-0.25], [80,-0.30], [100,-0.40],  [120,-0.45],  [140,-1.01]]);

Greetings, all!

I'm extremely new to Maple T.A., and I am building tools for my math department since I'm the only one with a programming background. I have a generic question, and sincerely apologize if I've missed it being answered elsewhere. It's a case that will probably come up multiple times for us, so I was hoping to find an answer =).

I have a problem where students are adding exponents of like bases. As an example, you get questions that look like this.

When the coefficient is 1, I'd like to accept a blank answer in the first response area as a correct solution. Is there an easy (or less easy =) way of making this happen?

Thanks in advance!

I came across this interesting image restoration in the Mathematica community http://community.wolfram.com/groups/-/m/t/873396 and wondered how this could be applied in Maple.

 

Hello everyone,

I have an issue that I don't know how to solve.
I would like to plot a part of a surface that is enclosed by another surface. I wrote a proc() function with an if statement and when the statement is statisfienied I returned desired function. The roblem is that if statement gets ploted as well..

Here is my proc()

yield := proc (sigma__x, sigma__y, tau__xy, sigma__cx, sigma__cy, f__45, f__cx, f__cy, tau__u, f__tx, f__ty, alpha)

if eval(evalf(f__r(sigma__x, sigma__y, tau__xy, f__tx, f__ty, alpha)) < 0) then

return f__h(sigma__x, sigma__y, tau__xy, sigma__cx, sigma__cy, f__45, f__cx, f__cy, tau__u)

else 9999999

end if

end proc;


Here is my plot request:


Explore(implicitplot3d('yield(sigma__x, sigma__y, tau__xy, sigma__cx, sigma__cy, f__45, f__cx, f__cy, tau__u, f__tx, f__ty, alpha)' = 0, sigma__x = -10 .. 10, sigma__y = -10 .. 10, tau__xy = 0 .. 10, style = surfacecontour, numpoints = 100000, axes = normal), parameters = [f__cx = 0.1e-3 .. 10, f__cy = 0.1e-3 .. 10, f__45 = 0.1e-3 .. 10, sigma__cx = 0.1e-3 .. 10, sigma__cy = 0.1e-3 .. 10, tau__u = 0.1e-3 .. 10, f__tx = 0.1e-3 .. 10, f__ty = 0.1e-3 .. 10, alpha = 0.1e-3 .. 10]

 and this is what i get:

plot

The grainy surface should not be there. If it's not possible to remove it, it would be alright that surface would be smooth. Any ideas?


Maple evaluates:

but when I ask:

Maple will verify sin(u)/cos(u)=tan(u) but beyond that it does not seem to work too well. I suspect this has something to do with verify being a "semi-boolean" function but searching the docs for what that mean returns no results. It may mean "I am unable to decidee". But how should I know? :-(

This is Maple 2016.1 on Windows. There is a post on verifying very simple identities.

Edit As usual some very helpful answers for which many thanks. It is poor that Maple does not document the meaning of FAIL.It seems that for trig identities the expandverfier is the best.

Edit Maple documents FAIL under ? FAIL. I am not sure how I got a blank page when I searched.

 

Couldn't any question with title beginning with http be removed automatically? There has been quite a few containing nothing but spam.

Dear Community,

Is there an easy way to convert elapsed days since January 1 1900 to date, i.e. to year, month, day in Maple? E.g. 23021 days should convert to 1963.01.10. Also what is the opposite, i.e. from date to elapsed days?

tx in advance,

best regards

Andras

Hello Everyone

 

I have an expression which I would like to integrate from x=0 to x=L. The expression is 

x1:=(sin(beta*x)*cos(m*Pi*x/L))/(1+alpha*x)

 

Here, beta, m, alpha are constant. However I want the result in terms of these quantities.

 

I will be grateful if you could help mw in this regard.

Thanks a lot.

Ex: Give: Sum = 16;

Result: [1,3,5,7]

Dear All,

I am going to solve the following systems of ODEs but get the error: Newton iteration is not converging.
Could you please share your idea with me. In the case of AA=-0.2,0,0.2,0.4,...; I could get the solution.
Thank you in advance.


restart;
with(plots);
Pr := 2; Le := 2; nn := 2; Nb := .1; Nt := .1; QQ := .1; SS := .1; BB := .1; CC := .1; Ec := .1; MM := .2;AA:=-0.4;

Eq1 := diff(f(eta), `$`(eta, 3))+f(eta).(diff(f(eta), `$`(eta, 2)))-2.*nn/(nn+1).((diff(f(eta), eta))^2)-MM.(diff(f(eta), eta)) = 0; Eq2 := 1/Pr.(diff(theta(eta), `$`(eta, 2)))+f(eta).(diff(theta(eta), eta))-4.*nn/(nn+1).(diff(f(eta), eta)).theta(eta)+Nb.(diff(theta(eta), eta)).(diff(h(eta), eta))+Nt.((diff(theta(eta), eta))^2)+Ec.((diff(f(eta), `$`(eta, 2)))^2)-QQ.theta(eta) = 0;
Eq3 := diff(h(eta), `$`(eta, 2))+Le.f(eta).(diff(h(eta), eta))+Nt/Nb.(diff(theta(eta), `$`(eta, 2))) = 0;

bcs := f(0) = SS, (D(f))(0) = 1+AA.((D@@2)(f))(0), theta(0) = 1+BB.(D(theta))(0), phi(0) = 1+CC.(D(phi))(0), (D(f))(etainf) = 0, theta(etainf) = 0, phi(etainf) = 0

Error, (in dsolve/numeric/ComputeSolution) Newton iteration is not converging

how to translate python code which use scipy, numpy to maple code

 

 

import numpy as np
from scipy.sparse.linalg import svds
from functools import partial


def emsvd(Y, k=None, tol=1E-3, maxiter=None):
    """
    Approximate SVD on data with missing values via expectation-maximization

    Inputs:
    -----------
    Y:          (nobs, ndim) data matrix, missing values denoted by NaN/Inf
    k:          number of singular values/vectors to find (default: k=ndim)
    tol:        convergence tolerance on change in trace norm
    maxiter:    maximum number of EM steps to perform (default: no limit)

    Returns:
    -----------
    Y_hat:      (nobs, ndim) reconstructed data matrix
    mu_hat:     (ndim,) estimated column means for reconstructed data
    U, s, Vt:   singular values and vectors (see np.linalg.svd and 
                scipy.sparse.linalg.svds for details)
    """

    if k is None:
        svdmethod = partial(np.linalg.svd, full_matrices=False)
    else:
        svdmethod = partial(svds, k=k)
    if maxiter is None:
        maxiter = np.inf

    # initialize the missing values to their respective column means
    mu_hat = np.nanmean(Y, axis=0, keepdims=1)
    valid = np.isfinite(Y)
    Y_hat = np.where(valid, Y, mu_hat)

    halt = False
    ii = 1
    v_prev = 0

    while not halt:

        # SVD on filled-in data
        U, s, Vt = svdmethod(Y_hat - mu_hat)

        # impute missing values
        Y_hat[~valid] = (U.dot(np.diag(s)).dot(Vt) + mu_hat)[~valid]

        # update bias parameter
        mu_hat = Y_hat.mean(axis=0, keepdims=1)

        # test convergence using relative change in trace norm
        v = s.sum()
        if ii >= maxiter or ((v - v_prev) / v_prev) < tol:
            halt = True
        ii += 1
        v_prev = v

    return Y_hat, mu_hat, U, s, Vt

hi.how convert root of to explicit form.

w is a imaginary..

thanks

123.mw

restart; w := (1/2)*(2*d-5+I*sqrt(4*d-9))/(d-2)

(1/2)*(2*d-5+I*(4*d-9)^(1/2))/(d-2)

(1)

with(LinearAlgebra):

{Q1 = RootOf((2*I)*(4*d-9)^(1/2)*_Z*d-((2*d-5+I*(4*d-9)^(1/2))/(d-2).(d*(I*(4*d-9)^(1/2)+1)*_Z/((d-2)*b)))*b*d+2*((2*d-5+I*(4*d-9)^(1/2))/(d-2).(d*(I*(4*d-9)^(1/2)+1)*_Z/((d-2)*b)))*b-2*d*_Z), Q2 = -(1/2)*d*(I*(4*d-9)^(1/2)+1)*RootOf((2*I)*(4*d-9)^(1/2)*_Z*d-((2*d-5+I*(4*d-9)^(1/2))/(d-2).(d*(I*(4*d-9)^(1/2)+1)*_Z/((d-2)*b)))*b*d+2*((2*d-5+I*(4*d-9)^(1/2))/(d-2).(d*(I*(4*d-9)^(1/2)+1)*_Z/((d-2)*b)))*b-2*d*_Z)/((d-2)*b)}

(2)

``

 

Download 123.mw

Dear Community,

How could I specify a list of random colors using some kind of an RGB function, which then could be used in another command for coloring? I think of something like this:

myColors := [ seq( RGB ( [rint(0,255) , rint(0,255) , rint(0,255)] ) , j = 1 .. 20 ) ] :

which does not work of course :-)  This should produce me a list of 20 random colors.  What would be the right RGB color function?

Tx for the kind help in advance

best regards

Andras

Dear Community,

I generate two vectors and try to plot them one vs. the other ( ZPLOT vs. PREDS )  with the pointplot command. Unfortunately I get the message "points are not in the correct format" ... Probably a minor error, but it is unclear what format Maple expects here? What do I do wrong?

Tx. for the kind help in advance,

best regards

Andras

P.S. Maple file attached

Z_DAK_PROC.mw

4 5 6 7 8 9 10 Last Page 6 of 1326