sakhan

50 Reputation

6 Badges

17 years, 219 days
Attock, Pakistan

MaplePrimes Activity


These are replies submitted by sakhan

 

@Markiyan Hirnyk  

Unlike yours, I am not getting the correct output.

It appears the indexes of each term changes correction.mw

 

 

 

There is another problem.

eq8:=eval(eq7, [a[j]= 0,  a[j+1/2]= 0,  a[j+1]= 0]):
eq9:=eq7-eq8=eq8;
 
eq10_1:=subs(phi[i](r)=phi[j](r), eq9):
eq10:=collect( subs(1..delta= t[i]..t[i+1], eq10_1), int);
 
The intergrals here have phi[i]'s as their integrand. 
I have the phi[i]'s
t[i+1/2]:=t[i]+h/2:
t[i+1]:=t[i]+h:
phi[i]:=piecewise(r>=t[i] and r<=t[i+1],1-3*((r-t[i])/h)+2*(((r-t[i])^2)/h)): 

phi[i+1/2]:=piecewise(r>=t[i] and r<=t[i+1], 1-4* (((r-t[i+1/2])^2)/h),0): 

phi[i+1]:=piecewise(r>=t[i] and r<=t[i+1],1+3*(r-t[i+1])/h+2*((r-t[i+1])^2)/h,0):
 
 
Now If now do some thing like 
> eq10;  
the maple kernel give some connection lost message.
I know the problem, the answer to those integrals are very long expression but if we
 use simplify command right after evaluation of each integrals, the expression gets
 simplified. For example
If I calculate 
> int(phi[i]*diff(phi[i+1/2],r)*diff(phi[i],r), r=t[i]..t[i+1])assuming h>0;
The ansewr is a long expression but If I do right after 
> simplify(%);
The answer gets simplifiied to very large extent.
Now since in eq10 I dont have any control on the evaluation of integrals,
 I cant use the simplify command after the execution of each integral. 
So I am looking for some way that I can use simplify command after the
 evaluation of each integral in eq10 or some other with which maple is
 forced to use simplify or similar command after each integral evaluation in eq10.
Thanks!!

There is another problem.

eq8:=eval(eq7, [a[j]= 0,  a[j+1/2]= 0,  a[j+1]= 0]):
eq9:=eq7-eq8=eq8;
 
eq10_1:=subs(phi[i](r)=phi[j](r), eq9):
eq10:=collect( subs(1..delta= t[i]..t[i+1], eq10_1), int);
 
The intergrals here have phi[i]'s as their integrand. 
I have the phi[i]'s
t[i+1/2]:=t[i]+h/2:
t[i+1]:=t[i]+h:
phi[i]:=piecewise(r>=t[i] and r<=t[i+1],1-3*((r-t[i])/h)+2*(((r-t[i])^2)/h)): 

phi[i+1/2]:=piecewise(r>=t[i] and r<=t[i+1], 1-4* (((r-t[i+1/2])^2)/h),0): 

phi[i+1]:=piecewise(r>=t[i] and r<=t[i+1],1+3*(r-t[i+1])/h+2*((r-t[i+1])^2)/h,0):
 
 
Now If now do some thing like 
> eq10;  
the maple kernel give some connection lost message.
I know the problem, the answer to those integrals are very long expression but if we
 use simplify command right after evaluation of each integrals, the expression gets
 simplified. For example
If I calculate 
> int(phi[i]*diff(phi[i+1/2],r)*diff(phi[i],r), r=t[i]..t[i+1])assuming h>0;
The ansewr is a long expression but If I do right after 
> simplify(%);
The answer gets simplifiied to very large extent.
Now since in eq10 I dont have any control on the evaluation of integrals,
 I cant use the simplify command after the execution of each integral. 
So I am looking for some way that I can use simplify command after the
 evaluation of each integral in eq10 or some other with which maple is
 forced to use simplify or similar command after each integral evaluation in eq10.
Thanks!!

Thank you!

I have figured out the way to find the integration, the ODE declaration was incorrect.

I should have

 

ODE_1:=diff(w(r),r)+R*(diff(w(r), r))^3-K/r;

@Preben Alsholm 

Thanks for this lovely piece of code, I really enjoyed the way you converted the whole domain in to just two variables which clearly minimizes the complexity of the situation.

I had an oversight

 K[i,i]:=int(diff(phi[i], t)*diff(phi[i], t), t=x[i]..x[i+1]) assuming h>0;


should be 

 K[i,i]:=int(diff(phi[i], t)*diff(phi[i], t), t=x[0]..x[N]) assuming h>0;


( since the previous one does not includes x[i-1] over which phi[i] is clearly defined)


The 

 K[i-1,i]:=K[i,i+1];
 
should be 
 
 K[i,i-1]:=K[i,i+1];
 
(the matrix is clearly tridiagonal and by this I was trying to fill the lower sub-diagonal due to symetricity. I could not see this until I started tracing it, sometime this happens :( 
Thanks all for sparing some time to have a look.
(sorry for wrong comprehension, though a spell checker wont hurt)

@Preben Alsholm 

Thanks for this lovely piece of code, I really enjoyed the way you converted the whole domain in to just two variables which clearly minimizes the complexity of the situation.

I had an oversight

 K[i,i]:=int(diff(phi[i], t)*diff(phi[i], t), t=x[i]..x[i+1]) assuming h>0;


should be 

 K[i,i]:=int(diff(phi[i], t)*diff(phi[i], t), t=x[0]..x[N]) assuming h>0;


( since the previous one does not includes x[i-1] over which phi[i] is clearly defined)


The 

 K[i-1,i]:=K[i,i+1];
 
should be 
 
 K[i,i-1]:=K[i,i+1];
 
(the matrix is clearly tridiagonal and by this I was trying to fill the lower sub-diagonal due to symetricity. I could not see this until I started tracing it, sometime this happens :( 
Thanks all for sparing some time to have a look.
(sorry for wrong comprehension, though a spell checker wont hurt)

May God bless you!!!

May God bless you!!!

May God bless you!!!

May God bless you!!!

1 2 Page 2 of 2