Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

I fail to see the point.  You have a nice formula for W.
Certainly with

W:=(p,n,mu,w)->Sum(w[k] * (n-k)^p * mu^(n-k),k=1..n);
you have
combine(mu*diff(W(p,n,mu,w),mu));

but so what?

Surely you could do

restart;
W[0]:=Sum(w[k]*mu^(n-k), k = 1 .. n);
for p from 1 to 5 do W[p]:=combine(mu*diff(W[p-1],mu)) end do;

But why?

I noticed that the graphs at the end were not really showing up, so I separated the two plots, which helped:

p1:=plot(q,k_=min(y_data)..max(y_data));
p2:=plot(inverted_pairs,style=point,color=blue);
plots:-display(p1,p2);

and so did

plot([q,inverted_pairs],k_=min(y_data)..max(y_data),style=[line,point],view=0..max(x_data));


@Marcy49 If you don't see it then go to the Control Panel and there (in Windows 7 at least) you find "Clock,Language, and Region" and below "Change keyboard or other input methods". Try that. You get a window with a button "Change keyboards...".  In the window you get you will find the languages you have chosen, in my case Danish and US. Besides that you can find out where the "language bar should be. I just found out that mine was floating on desktop, which is why I now find it up on the top right.

If you only have one language then this may not be your problem. But it is worth looking into.

It is strange that using bold in Maple cures the problem, so the problem may not be related to languages.

@Marcy49 Sometimes it happens to me that my keyboard, which is Danish, switches to US. Maybe because I inadvertently hit some keys. In my case this means that (as an example) I get ) instead of = and - instead of +. I'm using Windows 7. At the bottom right there is an icon looking like a keyboard (if you look closely).
If you have a choice there then choose the keyboard you are used to.

 

In Maple with my Danish keyboard and with the US setting for a=b; I get
a)b<
and for a+b;  I get
a-b<

When you say that "=" and "+" don't work what do you mean?

When you try to write

a=b;

or

a+b;

what do you get?

@Carl Love Another fix is turning Pi into a float:

DEplot(evalf(de), h(t), t=0..300, [h(0)=10], h(t)=0..11);

@Rouben Rostamian  It couldn't hurt to report it.
I remembered seeing this error sometime ago and found out that I have a very short worksheet from March 28 2014 exibiting the error.
My guess is that I filed an SCR at the time.
Incidentally, it would be nice if one received an acknowledgment of receipt and a copy of what was filed as an SCR.

The file contains the lines:
restart;
p:=piecewise(x<1,67,0);
solve(p=a/b(0),a);
solve(p=a/b,a);
solve(p=a/exp(1),a);

####To which I now added
solve(p=a*Pi,a);

If the bug was reported at the time it would be too late for correction as Maple 18 was already released (as I recall).
The bug is not present in Maple 16.

@syilalala Without shooting I had success with adding an approximate "solution". As you will notice it is not very sophisticated.

bcs:={G(0) = 0,f(0)=0, f1(10) = 1, f1(0) = -0.5, g(0) = 1, g(10) = 0};

res:=dsolve(ODE union bcs,numeric,approxsoln=[f(eta)=eta,f1(eta)=1,f2(eta)=0,g(eta)=1,g1(eta)=0,G(eta)=eta]);

plots:-odeplot(res,[eta,f1(eta)],0..10);
plots:-odeplot(res,[eta,f(eta)],0..10);
plots:-odeplot(res,[eta,g(eta)],0..10);
plots:-odeplot(res,[eta,G(eta)],0..10);
res(10);


To get reasonable and not just responses based on guesses about what you actually did, you could tell us just that. What did you do to solve the system? What was lambda? What did you use in place of infinity?
How did you get g from the results of the ode system?
Why don't you just include G as G(eta)=int(g(t),t=0..eta) in the system in the form of
diff(G(eta),eta)=g(eta) with G(0)=0 ?

@shabahang I believe you are wrong. Although pi and Pi look the same in output when entered as
pi;
Pi;

they are not the same. pi is just a name, Pi is the mathematical constant with approximate value 3.14159265.

Try
evalf(pi);
evalf(Pi);

Could you give us the lines of code you are using?

@ger89 I shall try to answer the questions one by one.

1. You don't know right away, but by trying first without the change _c[1]=c^4*L^(-4), as you would surely do, you may see that that change would make results look much nicer and more compact.

2. As I wrote earlier surely you didn't mean I*E, but EI or IE, i.e. a name. I was once exposed to some engineering and vaguely remember seeing EI used in this context (so I should have used EI, not IE).
Anyway IE or EI is just a factor in what you wrote as
eval(IE*(D[1, 1](w))(x, t), x = L) = 0 (I have replaced I*E by IE)
and presumably IE<>0 so that is equivalent to
eval(D[1, 1](w)(x, t), x = L) = 0
which is the same as
D[1, 1](w))(L, t) = 0

3. My answer here is similar to my answer to question 1. You observe that besides parameter c the equation resulting from
eval(ode1,{_c[1]=c^4*L^(-4),_F2=G});
includes IE/L^4/m. Thus it only depends on IE/m, L, and c. You could say that I should have let K=IE/L^4/m, and I suppose maybe I should.

4. Thanks to Carl for answering that.

5. Notice that sol1 contains two arbitrary constants _C1 and _C2. In order to plot anything they have to be given concrete values. The two values were taken out of thin air. There is no good reason why you shouldn't choose _C1=1,_C2=0 instead if you are interested in showing the eigen-vibrations (or whatever they are called) corresponding to the eigenfrequencies r[i].
After all a sum like a*cos(w*t)+b*sin(w*t) may be written as A*sin(w*t+phi), and in this context do we care about a phase shift phi or whether the amplitude is A or 1?

Just a comment.
I now remember that I raised the issue of solving for functions of floats in MaplePrimes at

http://www.mapleprimes.com/questions/202411-Solving-For-Function-Of-Float

The problem is illustrated here:

restart;
solve(f(0.1)=5,f(0.1)); #returns NULL
solve(f(1/10)=5,f(1/10)); #OK

To solve the problem we could either convert all floats to rationals by
vals:=convert(vals,rational);

or just convert the arguments to the functions, i.e. the independent variables:

vals:=evalindets(vals,name=float,convert,rational):

thereby keeping the function values as floats.

The reason why my version was slow seems basically to be that in my last loops the procedure D is called Ns*NP*NC times. D is also called when using solve. There is no reason why D should be called in those cases. D should just be replaced with something inert, i.e. just a name like DD. I tried doing it here:
df_dz[s][i,j]:=subs(D=DD,convert(df_dz[s][i,j],D));

Also I skipped
res1:=evalindets(res,function,x->op(0,x)):
and then the last loops would be

for s from 1 to Ns do
for i from 1 to NP do
for j from NP+1 to NP+NC do
Dpc[s,i,j]:=subs(vals,res,DD[j-NP](z[s][i])(seq(z[s][k],k=NP+1..NP+NC)));
od: od: od:

On a test with (Ns,NP,NC) = (5,50,10) this actually made my version 20% faster than yours in the float case (with the correction for the solve problem mentioned above).





@Carl Love You surely meant: The highest derivative of P in your ODEs is the first. Thus, you can only have three initial conditions, and you can't use D(P) as one of them.

First 128 129 130 131 132 133 134 Last Page 130 of 231