6473 Reputation

17 Badges

8 years, 44 days

MaplePrimes Activity

These are replies submitted by mmcdara


Now that you have said what you wanted, could you please tell me what what are the three equations whose lambda, m0 and n0 values are supposed to be the solutions?


Here is my last, and complete, work.

It seems there is no positive solution (for lambda__i1) for INDEX > 0.8736.
Maybe reducing the step of INDEX before reaching this value or increasing the number of Digits would prove I'm wrong

Maybe you could try to do some things on your own based ont the few ideas I develop in this file.

You ask "how to determine lambda, m0, and n0?", so what are the three equations you want to solve?

Here are a few examples of what can be done


Two issues related to running your script for ncal2:

  1. discontinuity emerges for sigma__delta1~0.27
    This discontinuity is not really an issue of my "my script".
    To see that, focus arrounf INDEX=0.27  by changing the for loop this way
    for INDEX from 0.250 by 1e-4 to 0.300 do
    and plot this
          lamRes1[1..arrInd-1,1], lamRes1[1..arrInd-1,i+1]
          , style=line
          , legend=typeset(U[i])
          , color=ColorTools:-Color([rand()/10^12, rand()/10^12, rand()/10^12])
        , i=1..6
    There is no discontinuity displayed.
    I guess this is the result of my using as initial point the value lam took at the previous INDEX value.
  2. fsolve() "breaks" at the 614th iteration
    Not a problem with "my script" but with a problem whose cause is your lam_ranges.


For INDEX = 0.613,  lambda__i1 =0.01001499459 and is a decreasing function of INDEX.
It is likely that the search range lambda__i1= 0.01 .. 1000 is the reason why fsolve fails for INDEX=0.614.


Reduce the lower bound of the search range for lambda__i1.

Be cautious, the same problem is going to happen lately for lambda__d1, so proceed the same wat for the lower search range of this latter  (For  INDEX = 0.808,  lambda__d1 =0.0100009314 and is a decreasing function of INDEX).

Last point: setting very lower bounds since the starting point appears to be a wrong idea because fsolve seems to be stucked somewhere.
So I implemented a kind of dynamic adjustment where we start with quite small lower bounds and decrease them if necessary as the previous solution approaches them.

In a couple of hours I will send you a file which enables reaching INDEX=1 (For the moment I'm stucked at INDEX=0.8733)

What you have to keep in mind is that fsolve will never be capable to solve any problem without ad hoc adjustments.
Very often you have to customize the way fsolve is used to give the correct/expected/desired/reliable result.
For instance my first script worked "by chance" on your first test case but failed four your second one. 
Identifying the causes of a failure is the first step, the simple one in fact.
Finding a reliable strategy to avoid it can be more tricky more specifically if you want to preserve reasonnable computational times.
I insist on these points because you will find soon a third or fourth or nth case on wich my last script fails.
In this case identify the causes and try to imagine 

@Carl Love 

hardheaded is the exact term.

@Carl Love 

I really have a hard nipple... 
I widened my eyes reading this and went to my favorite translator.

What does Deepl propose as alternative traductions for that?
(the French translation has the same sexual sense)

But looking for alternative translations we get

Whose reverse translation gives

I'm relieved, everything's back to normal.

But how the hell can Deepl translates nipple as "têton" (=nipple) or "neurone" (=neuron)?

This funny thing reminds me of something I read 30 years ago about the first translator.
People translated "The flesh is weak but the spirit is strong" into russian and next back to english to verified they recovered something close to the original text.
It is said they got "The flesh is rotten but the vodka is strong"  instead.

The moral is: Always translate back and forth to avoid an embarassing situation

I believe I got it! This is a Deepl bug.
Look at these three translations

The first one corresponds to what the OP wanted to say.
The third one translates just as the first one.
But if you want to change the last name in the first translation, Deepl proses "skull, brain, mind, nut, face, ...", but it proposes "nipple, noggin, nip, face, ... " for the third one.
It looks like Deepl was using the corpus correspondig to the second translation as a corpus for "head" in the third one.
Note that if you delete the three lines in the left panel and write again "J'ai vraiment la tête dure", proposals for "head" still are "nipple, noggin, nip, face, ... ".
Big Deepl is watching you.

@Carl Love 

I wrote all that a bit too quickly, this kind of question upsets me a bit.
I should stay more composed

The syntax of eq1 is not correct You could use the construction `if`(condition, action1, action2) but I advice you to write insted

eq1 := piecewise(delta*(alpha+beta)*d*h >= x*d*h, Q2, x*d*h-delta*(alpha+beta)*d*h);

# more simply

eq1 := piecewise(delta*(alpha+beta) >= x, Q2, x-delta*(alpha+beta));

Whatever, eq1 is not an inequality (contrary to eq2..eq3a) and cannot be put between braces in Minimize command.

Other point eq3 is always verified as soon as eq3a is and is thus useless.

TR has only two indeterminates, I1 and I2, but inequalities eq2, and eq3a contain new indeterminates alpha, beta, d, h.
So it makes no sense include them into the Minimize command, just do

eq2a := I1 - I2 <= 0;
S := Minimize(TRC, {eq2a}, assume=nonnegative)

# or  Minimize(TRC, {eq2a}, I1=0..8, I2=0..8);  # assume=nonnegative is then useless
        S := S := [5.852170015000*10^12, [I1 = 0., I2 = 4.44089209850063*10^(-16)]]

Last point: I don't understand what you mean by "find what is Q1 and Q2...", please clarify.

Suppose Maple nor any other CAS does exist and just think a few seconds by yourself.

Some gives you this expression res which depends on 

indets(res, name)
            {k, lambda1, lambda2, n, omega, rho, t}

7 parameters and ask you to find the values of lambda1, lambda2, omega and rho such that numer(res)=0 and denom(res)<>0.

Note that they aretwwo extremely complex expressions:

length(numer(res)), length(denom(res))
                        67327531, 22899

How do you react?
Probably you would start saying  "What do you mean by solve with respect to lambda1, lambda2, omega and rho ? What about n, k, t ? Did you realize you have two equations and 4 unknowns?";
and next "Have you seen how complex those expressions are? How dare you ask for an exact solution?";
to end with "Your expression contains the imaginary unit, does it means some parameters are complex? What does denom(res)=0 mean: for instance has the real part to be 0 or has its module to be 0?"

Start defining exactly what you want... but do not ask for the impossible, as I said  Maple is not a crystal ball. 

I insist on the qualifier INITIAL as your questions seems to evolve according to the replies you receive (which is pretty annoying).

The attached file shows there is no problem at all (at least with Maple 2015.2) to fsolve the 6 equations and get positive real values:

Were you aware that the solutions verify lambda_d1 = lambda_d2 and  lambda_i1 = lambda_i2 ?


@acer : it seems that DocumentTools is well adapted to place that "faked legend" you refered to

@Prakash J

(This is just an illustrative example for I don't know the values of the other parameters? So adjust my code to your own needs.)

plots[intersectplot] ?

Maybe using it will simplify your code

As X does not contain k it's hard to imagine how k disappears as you  "express X in terms of L".

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