mmcdara

802 Reputation

12 Badges

3 years, 160 days

MaplePrimes Activity


These are answers submitted by mmcdara

If you want a symbolic solution just use
dsolve({ode, bcs}, f(x))

But your second bc is not correctly stated : you should write f((4*10^(-8)-rho)^.5)= "some value"

Unfortunately, dsolve will return no result because the ode is not tractable symbolically.

Then you can try dsolve({ode, bcs}, numeric).
In which case you need to fix initial conditions, not "noundary" ones.
More of this, you need to fix the value of rho (unless you use paramerized dsolve : dsolve({ode, bcs}, numeric, parameters=[rho]) )

the correct syntax is a:=a+1  not (a=a+1) (idem for b, c, d)

answer.mw

First remark :
I loaded your file  Advheat-53.mw and got this error
Error, recursive assignment

It comes from the line "eqs := eqs, ....  " and tells you that "eqs" has not been already defined.


Second remark
In Advheat-54.mw : solve operates on a single equation or a set of equation (at least until MAPLE 2016 ... I do not have more recent versions).
The syntax of your last line is not correct and should be 
Array(1 .. 9, rhs~(convert( solve(eqs, {seq(T[k], k = 1 .. 9)}) , list)))

In effect, eqs has a lot of indeterminates and you must tell MAPLE what are the ones it has to solve for, this is the meaning of {seq(T[k], k = 1 .. 9)}.

Now a computational issue: even if you execute this command you will be very disappointed by the result you'll get. I'm not even sur that you will obtain a solution (I can't).
Do not forget you have several fourth order equations to solve: the result will be amazingly huge if you look for a formal one.
To convince you, replace all the "4" in the fourth power by "m" in your eqyuations and execute 

Array(1 .. 9, rhs~(convert( solve( subs(m=1, eqs), {seq(T[k], k = 1 .. 9)}) , list)))

(ok, this is not the correct exponent, but just look to the result)

Now do the same thing for m=2 and observe what happens.


Some hints

  1. If a numerical solution satisfies you, I suggest to fix the values of all the quantities, but the T[1..9], in eqs and use fsolve instead of solve.
    Syntax    Array(1 .. 9, rhs~(convert( solve(eqs) , list)))
     
  2. If you need want a formal solution of this advection problem, MAPLE proposes you the procedure "pdsolve". Please have a look to it and let me know if it could suit you.
     
  3. It's likely that someone here will have other(and better) ideas


But for the moment I'm affraid that yout problem, in the way you stated it, is untractable (?)

 

 

And a third one :

1 +~ Statistics:-CumulativeSum(X)

You see here that MAPLE has many overlapping feature: look to Carl Love's answer.

BTW : I didn't know the procedure PartialSums of the ListTools package

@Rouben Rostamian  @acer  @Mariusz Iwaniuk 

Some of the solutions are based on some arbitrary cutoff and I do not consider they are correct.

Rouben's cutoff-free solution is far better ... if we accept a zero gravity of course !!!

You will find in the attached file another solution free of any trick  (excepted the instruction in pink used here to prevent null time ranges).
The solution is piecewise constructed (a strategy I use to use for more complex situations than the bouncing ball test case).

Make a zoom around the 16th rebound (t=4.2425543703...) for a detailed comparison between Rouben's solution and mine's


bouncing_ball.mw

 

 1/ There is no deed to write f(x_i,y_i)=0.01 explicitely: just define a new function g(x_i, y_i) = f(x_i, y_i)-0.01
      The "constraint" the becomes g(x_i, y_i) = 0. This is not simpler: we just discard a useless numerical value.

2/ You say that f depends on some parameter, let's say p, you "calculated" by some optization process. 
     When does this process occur? Befor generatind the points, or after having generating them ?
     
Without more explanation I'm not sure anyone can give you the answer you are looking for?


Example   :  g(x, y, p) = x-y-p
                    Your "constraint" is g(x, y, p)=0.
                    A trivial solution is x_i = y_i for all i and p = 0
                    Another one is x_i = y_1 + 1 and p = -1

Please have a look to the attached file.
I do not find your second-order approximation but some mistake of my side is not exluded (it would have been safer for me to provide Maple code instead of Latex code).

qwerty.mw

First pointError, (in int) integration range or variable must be provided


pn:=proc(i,n,t)
if n=1 then return int(hd[i],t) fi:
return int(pn(i,n-1,t)):
end proc:

When n = 2 (your instruction  tmp := alpha1(t)*pn(i,1,t)+alpha2(t)*pn(i,2,t): ) the error message means there is no integration variable.
Changing int(pn(i,n-1,t)) by int(pn(i,n-1,t), t) eludes this message.


Second point: the execution of the line  A := Transpose(LinearSolve(Transpose(H+TMP), R))  takes a very huge amount of time (Maple 2017.2).
So I propose to rewrite the system in a more symbolic way (see the attached file   # let's try to solve the system in a more symbolic way)

Third point   Error, missing operator or `;`
Change "sum" into "add" after line #Now compute the approximate solution

example_1.mw
 

 

 

@raghav6594 

Without presuming about what you really want to do ...

Your function is zero almost everywhere, which will be very difficult, if not impossible, to use it in an ODE/PDE problem.
Maybe a softened version of it could be sufficient ?
Without any pretention the attached file presents a simple idea to implement and use such a softened function.

sha.mw

From my experience (it is just my personal position and you will probably encounter people claiming the opposite): I never use the document-style worksheet as soon as the worksheet is relatively large, or until I do not need to have pretty inputs.
More generaly I'm not at all confident in the java interface ...

So my advice would be

  • go to the preferences
    • click on the "display" item
      • first item "input display" : select "Maple notation"
    • bottom : "apply to the session"
  • open a new worksheet in WORKSHEET-MODE style
  • copy into it "instruction by instruction" (to avoid loosing the Maple notation mode) the content of your document-style worksheet.

It should work correctly.

The attached file contains  the beginning of the "new" worsheet

EulerLagrange.mw

This is an ad hoc way to proceed (the different situations "lambda__2 real" and "lambda__2 complex" are treated separately).
It can give you some ideas to go further but a Maple-Geek will certainly provide you a more astute solution.

root.mw

Joel's answer is perfect.

In case you would prefer working with indexed elements   (for instance sm,n) instead of elements written like Smn, I can propose this to you

AX.mw

@Mariusz Iwaniuk 

 

You just need to form the difference between two infinite series.
(I used the Summtools package but maybe (?) "sum" could do the job as well)

About Mathematica: is it possible that it uses the same trick
 

restart:

with(SumTools):

assume(r > 0):

_EnvFormal := true;
Summation(k^(r), k=1..infinity)

true

 

Zeta(-r)

(1)

S1 := Summation((a+d*k)^(r), k=1..infinity)

Zeta(0, -r, (d+a)/d)*d^r

(2)

assume(N > 1);

f := expand(a+d*(k-N));
f0 := coeff(f, k, 0);
f1 := coeff(f, k, 1);


S2 := Summation((A+B*k)^(r), k=1..infinity)

-N*d+d*k+a

 

-N*d+a

 

d

 

Zeta(0, -r, (A+B)/B)*B^r

(3)

subs({A=f0, B=f1}, S2)

Zeta(0, -r, (-N*d+a+d)/d)*d^r

(4)

S := S1 - subs({A=f0, B=f1}, S2)

Zeta(0, -r, (d+a)/d)*d^r-Zeta(0, -r, (-N*d+a+d)/d)*d^r

(5)

 


 

Download Serie.mwSerie.mw

I understand your problem this way :

  • You have a function F in N parameters P1, ..., PN.
  • Each of them is modeled by a random variable
  • Then Z = F(P1, ..., PN) is a random variable too
  • Sensitivity Analysis (SA), in the statistical sense, assesses the variation of the "ouptut" Z given the variations random variations of the "inputs" P1, ...PN

 

There are two types of SA :

  • local : it is based on (generally first order by also second order can be used) partial derivatives of F arround at some point 
  • global : doesn't assume the "smallness" of the variations of the inputs the local SA requires
    (a recent question here is about Sobol indices, a key item in global SA)

 

It seems your are interested by local SA (LSA) ?

One ingredient is given here by Rouben if you use first order LSA.
But it's not sufficient. Let denotes by Vn the variance of Pn and by Dn the partial derivative of Z according to Pn
In LSA the sensitivity coefficient Sn of Z to Pn is defined by 
Sn = Vn*(Dn)^2 / sum(Vm*(Dm)^2, m=1..N).

Is it what you want ?

Best regards


At a first step, one might infer that searching for some rule behind your sequence, reduces to find some rule in the sequences of the exponents.
A good starting point is the OEIS data base, look  https://oeis.org

OEIS doesn't reference any of these 3 sequences

  • the sequence of the exponents of 3
  • the sequence of the exponents of 2
  • the sequence obtained by interleaving the two previous one

Unfortunately OEIS handles sequences of integer only, so you can't go further (even the smallest is to high a number to be used in OEIS).
So the OEIS option seems to be given up.

Maybe knowing where your sequence comes from could help ?

First 7 8 9 10 Page 9 of 10