digerdiga

390 Reputation

8 Badges

11 years, 315 days

MaplePrimes Activity


These are replies submitted by digerdiga

Hey, Thx for this "tutorial"

A few "technical" questions:

1. What does rcurry precisely do here? I plotted the 3d below (which I expected to look the same as in your other worksheet rootof.mw) but it looks like this

Did something go wrong or why is it so perforated??

2. What does the ~ in degree~() mean? Are you assuming something I do not see?

In fact is it possible to turn of the ~ if a variable is assumed?

3. Looking at ?collect you are using distributed instead of expand here in order to have all terms (e.g. x*y^2) seperately and not bunching like (x+y)*y, right? But I didn't find the precise meaning of "normal"

4. Using the method of dominant balance there is also an intersection @ p=3/2. I know we already dealt with this one, but why is this still appearing? Does something possibly still balance here? 2. different p-exponents? Or is it only the mixing of a p-term and a constant term which is of importance?

@vv Why

'''sol'''(x) and not '''sol(x)'''

and why three times?

Once for eval then selec Re and min and again eval ?!?

Btw: Why doesnt

applyrule(k::anything*NO2^p::anything = p, %)

work on the big expression (sometimes) when I simplify it before? Apparently the expression has to be "expanded"

@_Maxim_ Ok srry I mixed that up...So below 2017.3 it is not possible as in your example to match x^p as a single pattern variable??

@_Maxim_

Your last example does not work for me:

restart;

applyrule([l::list = l, x^p::anything = [x, p, x^p]], a^2);

and only
a^2

is returned not [x,p,a^2]..

-------------------------

And I'm sorry, but I still have the issue

restart;

applyrule([l::list = l, (x^p)::anything = [x, p, x^p]], a^2)

Error, (in PatternMatching:-AlgStruct:-InsertPattern) first operand of `::' must be a name

Here the issue can be solved when I remove the brackets around x^p for whatever reason it doesnt like it...

But as before

restart;

applyrule([l::list = l, x^p::anything = [x, p, x^p]], a^2)


Error, (in PatternMatching:-AlgStruct:-InsertPattern) first operand of `::' must be a name

does not work :-((

 

I'm not sure if I pointed it out enough but it's really just x^p one time and x^p as 2d-version-input the other time...

 

PS: I tried using Maple 2015.1 and Maple17.02

@_Maxim_ Thx I didnt know that coeff either...That much I dont know -.-

Anyway...I was trying it out quickly yesterday night and I also used solve(%,A) on my 4th order coefficient, but got this insane long 4th order root expression...Must have done something wrong!

 

Maybe stupid question, but: When you used this plot all p values how did you see that 3/2 is the value you need? Ok I see that for p=3/2 the lowest slope intercepts the the constant 5 value (which stems from the 600NO2 term). But you say: "There is only one value of p where the lowest terms can balance out." If I would have chosen p<3/2 for example p=5/4 in order for the terms of order 4.5 to vanish, it would then give me A=0...Is there a condition that the power of the term whose coefficient has to vanish is integer???

PS: with free term you mean NO2^0 I guess, or?

 

PPS: I just noticed that when I replace NO2^p by the NO2^p I get when writing it out

1)

applyrule(k::anything*NO2^p::anything = p, %)

2)

applyrule(k::anything*(NO2^p)::anything = p, %)

I just get p instead of the array. Do you know why?

 

 

Similarly

applyrule(conditional(NO2^p::anything, p > 4.5) = 0, (`@`(expand, P))(NO2, 600*NO2+alpha*NO2^(5/4))); applyrule(conditional((NO2^p)::anything, p > 4.5) = 0, (`@`(expand, P))(NO2, 600*NO2+alpha*NO2^(5/4)))

 

The first one works, while the second doesn't:

Error, (in PatternMatching:-AlgStruct:-InsertPattern) first operand of `::' must be a name

 

@_Maxim_ 

Thank you! I was trying to extract the numerator yes...Didn't know sth like numer() existed. Good to know!

Also I'm impressed by the tidyness of your worksheet. Good lesson!

When I'm using such a small charactersize I can hardly read anything...Maybe you are using different font or sth different than the typical italic?

I have a couple of questions:

1) applyrule(k::anything*NO2^p::anything = p, %)

What precisely do you do here?

applyrule(NO2^p::anything = p, %) just replaces NO2^p by the exponent. Ok and what is k:: anything supposed to do?

Apparently it just selects this exponent and neglects the rest, but I'm still somewhat confused about the notation.

2) I was wondering if your method worked for the first order which I determined by implicit differentiation. But when inserting A for the coefficient in P(NO2,A*NO2) and then sorting for NO2^p the lowest order is 4 which then would have to vanish, right? But this does not give me the wanted 600, or?

@Thomas Richard Thx. Is it worth to completely redo it for you as you proposed or do you already anticipate it being too much to look into anyhow?

@Thomas Richard 8th_order_mapleprimes.mw

I hope it's not too cluttered...Don't worry about the kappa=0 (or kappa=1) stuff. I only had it to quickly switch between different expressions.

So I can't reproduce the error I posted above unfortunately, while instead it only says division by zero...

My case of interest is the CO> 1/(2*k_OHCO)~176.74... *10^-9 M0 where the solutions suddenly have a change in behaviour...The first order approximation to the solution is 600NO2 in numerics and I want the second order which exists for CO smaller that point (singularity?)

Further below I tried to do it manually via implicit differentiation and I get a numerator of 10th order while the denominator is 12th order -> then doing the limit NO2=0 it blows up...

So maybe you have some insights in why there is no further expansion I would really appreciate!

 

PS: If I comment back in the k_HO2HO2=0 then the solution reduces to 4th order and I do get a 2nd order approximation!

plot([x -> r(x, 1)[1], x-> r(x, 1)[2]], -.4 .. .2);

Is it also possible to write

plot([x -> r(x, 1)[1], x-> r(x, 1)[2]],x= -.4 .. .2);

coz this gives an error!?

 

A similar question would be:

Why is this working

plot(proc (x) options operator, arrow; eval('r(x, a)', [x = x, a = 1]) end proc, -1 .. 1)

while

plot(eval('r(x, a)', [x = x, a = 1]), x = -1 .. 1)

does not work...

@_Maxim_  "Note that you can't plot a procedure that returns a list, you have to write out the components."

 

Thats why it doesnt work? And what is the purpose? Isn't a procedure returning a list not valid?

plot([1,2,3],x=-1..1)

also is just a list given to the plot procedure...

Anyway: plot(eval('r(x, a)', [a = 1, x = x]), x = -.2 .. .2)

This does also not work...

@_Maxim_ Why is in eval(f(x),x=1) f(x) considered unevaluated?!?!?

I'm using eval( ... ,x=1.0) to explicitly evaluate it...

 

What does ' '  do ?

Does every expression, e.g. plot evaluate the function before putting in the numerics?

like in:

g:=x->x^2

plot(g(x),x=-1..1)

g(x) is already evaluated as symbolic? If that is the case I would need

plot(eval(''r(x,a)'',[a=1,x=x]), x=-0.1..0.1)

but that tells me unable to evaluate the function to numeric values...

evaluating r(0.1,1) however gives me two numbers...

@Both: Following issue I have with this

restart;
Digits := 50;
poly := y^4+a*y^3-(1+x)*y^2+(1+x)*y*x+x^2;
sol := unapply([solve(poly, y, explicit)], x, a);
r := proc (x, a) options operator, arrow; select(proc (t) options operator, arrow; is(abs(Im(t)) < 0.1e-19) and is(0 < Re(t)) end proc, sol(x, a)) end proc;
evalf(sol(.1, 1));
eval(r(x, a), [x = .1, a = 1]);
r(.1, 1)

 

What am I doing wrong?? I would like to work with eval() though.

@vv Hey,

Using

r:=c -> max(select(t->Im(t)=0, [sol(c)])):

if there are numeric round offs, how can I implement the same accounting for these round offs?

r:=c -> max(select(t->Im(t)<10^-20, [sol(c)])):

does not work?!

First 8 9 10 11 12 13 14 Last Page 10 of 19