Hiya,
I have an implicit equation;
where,
> beta:= sqrt(lambda*alpha-(alpha/2)^2);
for some dimensionless variable alpha.
I want to solve the equation for lamba and plot it as a function of beta.... but I don't know how to go about it.
Thanks for your help
k
Just to clarify... tan(beta)
Just to clarify...
tan(beta) = -(2/alpha)*beta
k
A direct approach
Try this.
restart; eq1 := tan(beta)=-2/alpha*beta; 2 beta tan(beta) = - ------ alpha eq2 := beta = sqrt(lambda*alpha-(alpha/2)^2); (1/2) 1 / 2\ beta = - \4 lambda alpha - alpha / 2The first equation can be solved for alpha, and this can be substituted into the first to obtain:
eq3 := eval( eq2, isolate(eq1,alpha) ); (1/2) / 2 \ 1 | 8 lambda beta 4 beta | beta = - |- ------------- - ----------| 2 | tan(beta) 2| \ tan(beta) /Solving for lambda is now straightforward:
eq4 := solve( eq3, lambda ); / 2 \ beta \tan(beta) + 1/ - --------------------- 2 tan(beta) eq5 := simplify( eq4, trig ); beta - --------------------- 2 cos(beta) sin(beta) plot( eq5, beta=-Pi/2..Pi/2, view=[DEFAULT,-10..0] );Thanks! Looks much simpler
Thanks! Looks much simpler now, I'll try it out.
Ok, I've realised I've made
Ok, I've realised I've made a mistake, I infact want a plot of lamba in terms of alpha... which makes it more complicated I think.
I've tried following the method above...
eq1:= tan(beta)= -(2/alpha)*beta;
eq2:= beta=sqrt(lambda*alpha - (alpha/2)^2);
eq3:=eval(eq2,beta = solve(eq1,beta));
eq4:=solve(eq3,lambda);
plot(eq4,alpha=-2*Pi..2*Pi);
... which seems to be ok, until I get to the plot where I just get a straight line of gradient approx 0.25... which isn't what I expected...
Have I made an error somewhere?
Thanks
k
What did you expect?
It is not possible to solve the first equations for beta, in closed form. But, if you take the final result and expand it as a series you find:
eq1:= tan(beta)= -(2/alpha)*beta; 2 beta tan(beta) = - ------ alpha eq2:= beta=sqrt(lambda*alpha - (alpha/2)^2); (1/2) 1 / 2\ beta = - \4 lambda alpha - alpha / 2 eq3:=eval(eq2,beta = solve(eq1,beta)); (1/2) 1 / 2\ RootOf(2 _Z + tan(_Z) alpha) = - \4 lambda alpha - alpha / 2 eq4:=solve(eq3,lambda); 1 / 2\ - alpha \1 + tan(RootOf(2 _Z + tan(_Z) alpha)) / 4 series( eq4, alpha=0 ); 1 / 13\ - alpha + O\alpha / 4This is the series with the default order: 6. Increasing the order to 20 and 200 gives:
series( eq4, alpha=0, 20 ); 1 / 41\ - alpha + O\alpha / 4 series( eq4, alpha=0, 200 ); 1 / 401\ - alpha + O\alpha / 4Based on this, it certainly does appear as though you should have lambda=alpha/4.
The problem is that RootOf is always satisfied by _Z=0, but this is not the only solution. You need to get Maple to return a non-zero solution to the 2*_Z+tan(_Z)*alpha=0. To get a handle on approximate solutions, you might want to look at a series expansion for this equation (in _Z) and use these solutions as approximations to the non-zero solutions to 2*_Z+tan(_Z)*alpha=0.
Here is how this might proceed:
eq5 := solve( eq2, lambda ); 2 2 alpha + 4 beta ---------------- 4 alpha eq6 := eval( eq5, beta = solve(eq1,beta) ); 2 2 alpha + 4 RootOf(2 _Z + tan(_Z) alpha) ---------------------------------------- 4 alpha series( eq6, alpha ); 1 / 11\ - alpha + O\alpha / 4 eq7 := series( 2*_Z+tan(_Z)*alpha, _Z=0 ); 1 3 2 5 / 6\ (2 + alpha) _Z + - alpha _Z + -- alpha _Z + O\_Z / 3 15 sol := solve( eval(eq7,O=0)=0, _Z ); (1/2) / (1/2)\ | / 2 \ | 1 | 5 alpha - \-95 alpha - 240 alpha/ | - |- ---------------------------------------| , 2 \ alpha / (1/2) / (1/2)\ | / 2 \ | 1 | 5 alpha - \-95 alpha - 240 alpha/ | - - |- ---------------------------------------| , 2 \ alpha / (1/2) / (1/2)\ | / 2 \ | 1 | 5 alpha + \-95 alpha - 240 alpha/ | - |- ---------------------------------------| , 2 \ alpha / (1/2) / (1/2)\ | / 2 \ | 1 | 5 alpha + \-95 alpha - 240 alpha/ | - - |- ---------------------------------------| , 0 2 \ alpha / eq8 := seq( simplify(eval( eq5, beta=B )), B=[sol] ); 3 (1/2) (1/2) alpha - 5 alpha + 5 (-alpha (19 alpha + 48)) -------------------------------------------------------, 2 4 alpha 3 (1/2) (1/2) alpha - 5 alpha + 5 (-alpha (19 alpha + 48)) -------------------------------------------------------, 2 4 alpha 3 (1/2) (1/2) alpha - 5 alpha - 5 (-alpha (19 alpha + 48)) -------------------------------------------------------, 2 4 alpha 3 (1/2) (1/2) alpha - 5 alpha - 5 (-alpha (19 alpha + 48)) 1 -------------------------------------------------------, - alpha 2 4 4 alphaYou will have to decide which, if any, of these approximations is relevant for your problem.
Hoping this is helpful,
Doug
It is better in parametric form
writing lambda and alpha in terms of beta.
Thanks, that's certainly
Thanks, that's certainly given me something to think about.
Basically, I have a sturm liouville type problem where lambda is the eigenvalue... I'm expecting there to be infinitley many lamdas that satisfy eq1 since:
where x is beta and I've subbed alpha=5
I was looking for a general lambda_n and then investigate my solution for the slowest decaying exponential for n=1...
ok, new question(ish)...I've
ok, new question(ish)...I've got
eq1:= tan(sqrt(lambda*alpha-(alpha/2)^2))=-2/alpha*(sqrt(lambda*alpha-(alpha/2)^2));
Then, if I sub in a value for alpha, I can use fsolve to get a particular value for the smallest non zero lambda
eq2:=subs(alpha=2,eq1);
lambda1:=fsolve(eq2,lambda,Pi/2..3*Pi/2);
I was wondering, is there anyway of plotting this lamba1 as a function of alpha?
Thanks again,
lots of ways
There are several possible variants on the following. (Which you get might well depend on the style of whoever answered.)
acer
New question?
This looks pretty similar to the old question, with a small change of variables. What I might do is this:
> eq1:= tan(sqrt(lambda*alpha-(alpha/2)^2))
= -2/alpha*(sqrt(lambda*alpha-(alpha/2)^2));
eq2:= simplify(eval(eq1,lambda=mu*alpha)) assuming alpha > 0;
(I hope I'm right in assuming alpha > 0 for your problem)
> _EnvAllSolutions:= true;
alphaz:=solve(eq2,alpha);
> alpha1 := eval(alphaz, _Z1=1); lambda1 := mu*alpha1;
(_Z1 = 1 seems to give the least positive lambda for given alpha)
> plot([alpha1, lambda1, mu=0.27 .. 7.9], labels = [alpha, lambda]);