25 Reputation

0 Badges

1 years, 155 days

MaplePrimes Activity

These are replies submitted by Jjjones98

@ecterrab Edited to include worksheet. 

@Carl Love A specific example I have seen is to use the above method with 4 and 5 points to show that

$\int_0^1 dx (1-x)^(3/2) \cos (\pi sin x)$ 

is approximately 0.2207535344 and 0.2207486957 for the two cases.  Would I just use the code above with \cos (\pi sin x) as an example and then run k up to 4 and 5 each time?

@Carl Love I suppose the integral is an operator, so if you show that the relation holds for a particular smooth function, f is just an arbitrary smooth function so in principle it applies for all smooth f(x).  Otherwise, I am not sure how to prove that the relation holds for any suitable f.

@Carl Love I may have made a mistake on my original post.  Basically I am trying to show the following approximate relation (with the polynomials which have been established):

$\int_0^1 (1-x)^{3/2} f(x) dx = \sum_{k=1}^4 c_k f(x_k)$

where the $x_k$s are the four roots of phi_4(x)=0 and the c_k coefficients are to be found.  Unless I misunderstood, I took it that the Gaussian quadrature method combined with our orthogonal polynomials in some sense approximates the integral on the left-hand side of the above equation, where f(x) can be any function.

@Carl Love Thanks for this, I've gone through and it seems to make sense.  Could you clarify how I would use these polynomials with the Gaussian quadrature method to approximate the given integral?

@Rouben Rostamian  Not to worry, it was the Green's function I was looking to define, but I watched a video explaining the process, it's straightforward as you say.  You end up with 4 equations with 4 unknowns which is best solved with Maple, I will post the code here which I used to do this if anyone else is struggling with this part.  

G1:=(a*x^3)/6 + (b*x^2)/2;
G2:=(c*(x-1)^3)/6 + (d*(x-1)^2)/2;
eq1:=subs(x=u, G2-G1);
eq2:=subs(x=u, diff(G2,x)-diff(G1,x));
eq3:=subs(x=u, diff(G2,x$2)-diff(G1,x$2));
eq4:=subs(x=u, diff(G2,x$3)-diff(G1,x$3));
sol:=solve({eq1=0, eq2=0, eq3=0, eq4=1},{a,b,c,d});

@Rouben Rostamian  Apologies, but I am still not sure if I follow your method here.  What I have done is to start with the fourth-order derivative and then work backwards by integrating repeatedly.  So the third derivative is a for 0<x<u and a + 1 for 1>x>u.

I then repeat the integration until I get back to the piecewise definition of G with several constants in it.  I should be able to find the constants by applying the four BCs to G and its derivatives and the fact that the second derivative is continuous, but cannot seem to get it to work for some reason (I will be happy to put a system of linear equations in the constants on Maple, but I would like to see where the relations come from).  Are you suggesting that I apply the conditions you have outlined above as these surely only hold when you know there is continuity?

@Rouben Rostamian  I've been able to solve the problem now, thanks for explaining the theory behind it, I really appreciate it.  The only difference I took was, rather than talking about the difference satisfying homogeneous BCs, I stated that I was taking the solution as the sum of the solution of the homogeneous equation with inhomogeneous BCs (that's f(x)) and the solution of the inhomegenous equation with homogeneous BCs (that's z(x)), which works because the boundary problem is linear.  This is maybe equivalent to the way you phrased it.

@Rouben Rostamian  In the end I opted to go through the process by hand without relying on the dsolve command as I wanted to know what was going on 'behind the scenes' and didn't want to just to do it 'automatically'.  Could you advise how I would use this result for the piecewise definition to show that the solution to 

$\frac{d^4y}{dx^4}=f\sqrt{x}     y(0)=y'(0)=1, y(1)=2, y'(1)=3


y(x) = (16/945)*x^(9/2) + (370/189)x^3 - (622/315)x^2 + x + 1

Again, I would prefer the longer route and don't want to use the dsolve command to find this answer. 

@vv Thanks for this, I got the infnorm command to work for the Fourier series and found the number of terms required for a difference of 0.001 between the series and the exact value.  I am still having a few problems with Maple, could you advise how I would do the same for the following sum (this was the original alternative which I proposed and I would like to show that this is more accurate than the Fourier series):


I've tried it but cannot get the sum to work for some reason.

@Rouben Rostamian  Yes you're completely right, I think I just needed to refresh my knowledge of linear algebra.  I've done this part of the problem again properly by hand and found that you can easily arrive at a set of eigenvectors by inspection, and then from there you assemble a matrix U, invert it and can carry out the exponential that way.  I was actually wrong in saying that I had found an orthogonal matrix when I double-checked it, so good job we went over this again, thanks a lot.

@Rouben Rostamian  Sorry if i am being slow, but if the diagonalizable matrix we start with is real, then it can be expressed as PDP^{-1}.  In that case, the Ps are real as well, so the transpose of P is equivalent to the inverse.  A is real and symmetric so it can diagonalised with orthogonal matrices.

Or is is the case that P has to be unitary U in the decomposition for the case of the matrix exponential to work?  If that is the case I think my previous calculation is wrong, as I just showed that it was possible to decompose A into PDP^{-1}, where D is diagonal and P^{-1} is the transpose of P, and then used that to calculate the matrix exponential I needed, which looks similar to the one you have above.  Maybe this was just wishful thinking, as the transpose is obviously easier to calculate than the inverse.


@Rouben Rostamian  I'm not sure I follow, I have multiplied lambda with the transpose of the matrix U you have given, then multiplied by U, but I do not get A back.  Could you show explicitly how they multiply together to get A?

@vv I have the Fourier series, and I have another representation of cos (\alpha x).  This is the Fourier series for cos (\alpha x)/sin(\alpha \pi) and I used a different Fourier series to show that this gives another represention, which is superior to the approximation which the direct Fourier series gives.  However, I need to quantify the difference in error.  I hope that's clear.

@Rouben Rostamian   I am not sure if this is a full answer, since it is using the dsolve command and I'm not sure that the exercise wants you to do that.

To clarify, I proved for the Green's functon for the differential equation and specified conditions that G(x,u), diff(G(x),x) and diff(G(x),x$2) are continuous at x = u and also that in the limit as epsilon tends to 0, that diff(G(x),x$3) evaluated from x = u - epsilon to x = u + epsilon is equal to 1.

This was done using the delta function (since it's a fourth-order equation) and as you rightly say the related differential equation was to have the relevant Dirac delta function on the RHS.  As I say, I am pretty sure that using dsolve command and then simplifying is not what the exercise is asking for, as the exercises are fairly rigorous.



1 2 Page 1 of 2