MaplePrimes Questions

I am trying to define a periodic piecewise function where essentially for every positive integer I have an output of '1' and the output is '0' everywhere else. I want to use this function in defining a Partial Differential Equation as well.

This is how I have been going about it after reading through the answers on similar questions posted before:

f := piecewise(t::posint, 1, 0_otherwise):
p := 1:
fperiodic := eval(f, t = t-p*trunc(t/p)):

But when I plot it to just as a test, I get a dead plot:
plot(fperiodic, t = 0 .. 5)

 


                     
I am hoping for something like:

Please help!
TIA

The summation takes too long time. Please help me
 

 

 

 

 

Hello,

     I've been using the invhilbert procedure from the inttrans package, but I'm running into a small problem. I'm attempting to apply invhilbert to an unknown function, and then later evaluate that function. However, in one particular case (bad, below), it does not produce the expected output. Curiously, I noticed that if I did *two* substitutions (good, below), it produces the expected result.

with(inttrans):

pde := inttrans:-invhilbert(f(t,s),s,x):
def := g = ((t) -> exp(t)*sin(B)):

bad := f = ((t,x) -> (1 + exp(t)*sin(B))*sin(x+A)):
good := f = ((t,x) -> (1 + g(t))*sin(x+A)):

eval['recurse'](pde, [good,def]);
# -cos(A) exp(t) sin(B) cos(x) + sin(A) exp(t) sin(B) sin(x) - cos(A) cos(x) + sin(A) sin(x)
eval['recurse'](pde, [bad,def]);
# -exp(t) sin(B) cos(x) + sin(A) sin(x) - cos(A) cos(x)

As a side-note: this discrepancy was very delicate. Removing any of terms (for instance, A) causes both to give the same, correct answer.

For this particular problem, I was able to manually replace exp(t)*sin(b) with the function g(t) and get the correct result, but I was hoping for a more automated approach (I need to apply it to many equations). Is there any way to get the correct result from equation bad?

Thank you very much!

 Dear All, If I have a square with lenght b and width 2a

.The question is how can I make Maple plot this square as points

.I want to define a function f(x_[i],y_[i]) for all sides.

Thanks

restart;

with(VectorCalculus);

x := Vector([VectorCalculus:-`*`(VectorCalculus:-`+`(R, VectorCalculus:-`*`(r, cos(p))), cos(t)), VectorCalculus:-`*`(VectorCalculus:-`+`(R, VectorCalculus:-`*`(r, cos(p))), sin(t)), VectorCalculus:-`*`(r, sin(p))]);

s := [p, t];

g := Matrix(nops(s), nops(s));

for i to nops(s) do

for j to nops(s) do

g[i, j] := simplify(DotProduct(diff(x, s[i]), diff(x, s[j])))

end do

end do;

g;

with(Physics);

Setup(dimension = 2);

Coordinates(X = s);

Setup(metric = g);

g_[];

g_[mu, nu].Ricci[mu, nu]

 

I have one question already here: In the last step I calculate the Riemann-Scalar.

I was wondering if also this works:

SubstituteTensorIndices({rho = mu, sigma = nu}, Riemann[mu, nu, rho, sigma, Array])

but it is kinda weird. The LHS is the expression I want and the RHS keeps this Array format. What do I need to specify instead of Array in order for this to work properly...

 

Original Question:

Further I do the following...

Define(A[mu], F);

F[mu, nu] := D_[mu](A[nu](X));

g_[mu, nu].F[`~mu`, `~nu`];

SumOverRepeatedIndices(%);

SubstituteTensorIndices(nu = `~mu`, F[mu, nu]);

SumOverRepeatedIndices(%)

 

The first result using g_[mu,nu] gives me a contravariant D_ and a covariant A while the second approach (SubstituteTensorIndices) gives me the same result with D_ being covariant and A now being contravariant.

I tried to enforce the contravariance with `~mu` but it didn't work.

So is there a way to enforce this?

 

 

A last question:

If I replace D_ above by d_ the partial derivatives do not expand out.

What is the reason for this?

Similarly

Christoffel[mu, nu, nu].A[mu];

SumOverRepeatedIndices(%)

does not give me the real expression in terms of each component A[1] and A[2] the first time I use SumOverRepeatedIndices...I need to do it twice, why is that?

 

 

 

 

 

 

 

 

I'm also happy about general advices to improve the way I implemented everything.

Like is there any meaning for signature() if I specify the metric as I did above?

What is better to use here: Physics or Tensor Package?

Hello people in mapleprimes,

This time question is a sequel of the previous one:
https://www.mapleprimes.com/questions/224346-Batch-File-And-Directory
, where I could obtain the file with the output.
Maple has been terminated after exhausting the output file.

But, I want  to do the next calculation while using the result in the output file.
For that, I think it might be a good way to have maple calculate a mpl file again, after having added 
new expressions to the original mpl file. But, copying and pasting expressions seen in the output file to the original mpl file with my hand, seems a little messy.

So, what I want to know is whether there isn't a good way for continuing calculations one after another,
while having maple termination after each calculation.

I will be very glad if you will give me an answer to this question.

 Thanks in advance.

Hello i ve tried getting a decimal answer from this subs(x=7,diff(y,x$8)); where y:=sin((x^2)/((x^10)+4))*e^(3*x);
but its not working what should i do?

after the substituion i used evalf(%) but it still had an answer like this 

How do i get the decimal answer???

Thank you,

 

Hello,

     I've been trying to figure out how to partially expand a trig function using the sum-rule but not the multiple-angle rule. For instance, I would like to expand

sin(2*x+3*y)

to

sin(2*x)*cos(3*y) + cos(2*x)*sin(3*y)

Unfortunately, expand also uses the multiple-angle rules, which is unwanted. The trigsubs command looked promising, but I don't know the names of the variables (x and y here) a priori, so I believe I need something with type matching (like applyrule with x::monomial + y::monomial).

Thanks for your help!

In x axis (0..0.5,0.05) and y axis (0..1)

then how to plot this values 

[.486935382154125, .485087274176440, .483255914856304, .481441076124814, .479642533998987, .477860068520125, .476093463645627, .474342507167362, .472606990609939, .470886709216958, .469181461771770]

I originally posted this question @ Reconciling roots of a series  However, I got no responses.  I have done further work on the problem & attempted to delete my original posting to initiate this one.    I did not see the option to delete Reconciling roots of a series.  So if any website moderator can delete the original & leave this one stand that would be helpful.  The results in this posting are more illuminating.

I have an infinite series that is function of


                                   /2 Pi k x\
                               sin|--------|
                                     \   T    / where k is the frequency parameter that is an integer value from 1 to m.  The series is also linearly dependent on the coefficient, Ck.  However, Ck is nonlinear with respect to k.  3 other parameters are undefined, a0, N, & tau.  Taking the derivative of the series removes the constant a0 & the factor (2 Pi k)/T comes out of the sin term & the sin term bcomes a cos term.  N is a positive integer & tau is a real #, generally between 0 & 1.

The derivative of the series can be evaluated since Ck falls of by 1/k^2 which renders the factor (2 Pi k)/T to (2 Pi)/T.  All is well & MAPLE seems to confirm that by the result (5).  I then attempt to find the roots of the derivative after defining the values for m, a0, N, & tau with both the solveRootFinding:-Analytic commands.  The results from the 2 do not seem to coincide.

I then repeat the process with chek2.  Now there seems to be some overlap in the results.  But as I pointed out in Reconciling roots of a series in the case of chek the series parameters m, a0, N, & tau have not been assigned values.  In the case of chek2 those parameters do have assigned values; hence, the solution characteristics are different for the solve command, but not for RootFinding:-Analytic.

In a different problem, but somewhat related someone pointed out the superior computational performance of the RootFinding:-Analytic as opposed to the solve command.  The results here if I interpret them correctly suggest that the solve command can be WRONG altogether.  Can this be explained in a concise & coherent manner that most users can follow?  Also, solve can produce an analytic expression as opposed the RootFinding:-Analytic command.  Is there a way to use the RootFinding package to produce an analytical result?  In the case presented below I suppose the analytic result for solutions to chek would be JUNK?

reconcile_solns.mw

I wish to calculate connection, curvature, Ricci curvature etc. for a

Riemannian metric given as follows: there is an orthogonal frame of vector

fields with stipulated Lie bracket relations between them. The frame is

orthogonal but not orthonormal, and the lengths of its vector fields are functions

of a single function on the manifold. Given these metric values on the frame and the

Lie bracket relations, the covariant derivatives are in principle computable from the

Koszul formula, hence connection and curvature are all determined.

When I try to define the metric using a dual coframe in ATLAS's Metric

routine, it allows me to define it but claims there is not actual curvature.

From the help it seems the coframes used in this routine are always given

as differentials of coordinates. Is there a way to get the metric via the data

given above without putting in by hand all the different Koszul formulas etc.?

Can anyone explain this?
> if  3 = 0 mod 3 then print(good) else print(bad) end if;
                        bad

> if  0 = 3 mod 3 then print(good) else print(bad) end if;
                       good
 

Help me about Tabulate and append text below.

file help: text_and_tabulate.mw

Hello,

     The following system of ODEs is handled correctly by dsolve, but PDEtools:-Solve raises an error:

ranking := [{A(), B(x)}]:
eqn_sys := {D(B)(x) = 0, A()* D(B)(x) = 0}:
dsolve(eqn_sys, ranking);
# {A() = A(), B(x) = _C1}
PDEtools:-Solve(eqn_sys, ranking);
#Error, (in dsolve) found many possible indications of the solving variables as [{B(x)}, [{A(), B(x)}]]

In particular, it seems the error is raised when 1) the ranking is a nested list and 2) at least one of the ranking elements is a function without any arguments.

Admittedly, this is a very strange case, but I did run into this earlier today. Of course, the example here is contrived (the nested-list ranking is completely unnecessary for this example), but it illustrates the error.

As a workaround, I found replacing the function A() with its name A in the ranking solves this problem (it can be left as a function in the system of equations). Nevertheless, I thought I would point this out as it seems dsolve handles this just fine even without the workaround, and presumably PDEtools/Solve should be able to as well.

This seems similar to a previous bug; this bug was fixed in Maple 2018. Unfortunately, I haven't updated yet, so I can't verify if the patch solves this problem as well.

First 842 843 844 845 846 847 848 Last Page 844 of 2427