Why in the example 8 they can have more boundary conditions than equations?. I want to do something similar; solve a system of two equations with 4 boundary conditions, but matlab only let me put 2 boundary conditions.
Comment only
23 Apr 2013
Chebfun V4
Numerical computation with functions instead of numbers.
Hi Jeff
Sorry for the delay in replying. In your first problem, you haven't quite the boundary condition syntax correct. The following should work:
L = chebop(@(x,u) diff(u,4), [0,1]);
B = chebop(@(x,u) sin(x) + 0*u, [0,1]);
L.lbc = @(u) [diff(u,2), diff(u,3)];
L.rbc = @(u) [diff(u,2), diff(u,3)];
The y''''(x)=lambda*f(x)*y(x) problem should be possible also. Try something like the following, where sin is replaced by the m-file you wish to use to construct f:
f = chebfun(@sin, [0, 1]);
[V, D] = eigs(L, diag(f), 4);
Regards
Nick
P.S. Emailing discuss@chebfun.org or help@chebfun.org should result in speedier replies! :)
Comment only
08 Apr 2013
Chebfun V4
Numerical computation with functions instead of numbers.
Another question: I want to solve the eigenvalues and eigenfunctions of the following equation
y''''(x)=lambda*f(x)*y(x)
Here f(x) is a function defined in a seperate .m file. Is it possible to use chebfun to solve the eigenvalues and eigenfunctions?
Thanks.
Jeff
5
08 Apr 2013
Chebfun V4
Numerical computation with functions instead of numbers.
An excellent software!!! Definitely 5 star.
A quick question. I am using the chebfun function to find the eigenvalues and eigenfunctions of the following boundary value problem
D^4 y=lambda*y, y''(0)=y'''(0)=y''(1)=y'''(1)=0,
where D is the differential operator, lambda is the eigenvalue and the solution y is the corresponding eigenfunction.
I used the following code in chebfun:
L = chebop(@(x,u) diff(u,4), [0,1]);
L.lbc = @(u) diff(u,2);
L.lbc =@(u) diff(u,3);
L.rbc = @(u) diff(u,2);
L.rbc =@(u) diff(u,3);
[V,D] = eigs(L,trunc);
disp(diag(D)), toc
HOWEVER, the below error was reported
Error using eig
Matrix must be square.
Error in linop/eigs>bc_eig (line 288)
[V,D] = eig(full(Amat),full(Pmat));
Error in linop/eigs (line 94)
[V1,D1] = bc_eig(A,B,33,33,0,map,breaks);
Error in chebop/eigs (line 57)
[varargout{1:nargout}] = eigs(L,varargin{:});
Looks like I am on the right track but some nonsquare matrix caused that error. Sincerely appreciate your comments and suggestions.
Thanks.
Jeff
Comment only