Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to solve two nonlinear equations simultaneously
Replies: 1   Last Post: Mar 13, 2013 11:25 AM

 Alan Weiss Posts: 1,430 Registered: 11/27/08
Re: How to solve two nonlinear equations simultaneously
Posted: Mar 13, 2013 11:25 AM

On 3/13/2013 8:40 AM, GDV_MATHWORKS wrote:
> Hello, this is santhosh. I have a matlab query.Please give some
> solutions/suggestions to the problem.The problem is- I m trying to
> solve two nonlinear equations involving Bessel's coefficients
> simultaneously of variables (u*a), (k0*a) but i m not able to get a
> way to solve it. The matlab code is as given below....
> clc;
> close all;
> clear all;
> syms f nu
> w = 2*pi*f;
> c = 3*(10^8);
> lambda = c/f;
> er = 35.7;
> er3 = 2.33;
> er4 = 1;
> a = 15*10^-3;
> d = 1.5*10^-3;
> hs = 0.78*10^-3;
> beta = (2*pi)/lambda;
> k0 = w/c;
> u = sqrt(((k0*k0)*er)-beta^2);
> W = sqrt((beta^2)-((k0^2)*er));
> alpha1 = sqrt((u^2)-(er4*k0^2));
> alpha2 = sqrt((u^2)-(er3*k0^2));
> C = atan(alpha1/beta)-atan(((-1*alpha2)*coth(alpha2*hs))/beta);
> ai = nu/(k0*sqrt(er^0.5));
>
> Jn = besselj(nu, (u*ai));
> dJn = diff(besselj(nu,(u*ai)),(u*ai));
> Jn1 = besselj(nu, (u*a));
> dJn1 = diff(besselj(nu,(u*a)),(u*a));
> Yn = bessely(nu, (u*ai));
> dYn = diff(bessely(nu,(u*ai)),(u*ai));
> Yn1 = bessely(nu, (u*a));
> dYn1 = diff(bessely(nu,(u*a)),(u*a));
> In = besseli(nu, (u*ai));
> dIn = diff(besseli(nu,(u*ai)),(u*ai));
> Kn = besselk(nu, (W*a));
> dKn = diff(besselk(nu,(u*ai)),(u*ai));
>
> A = [Jn Yn (-1)*In 0;...
> u*dJn u*dYn (-1)*dIn 0;...
> Jn1 Yn1 0 (-1)*Kn;...
> u*dJn1 u*dYn 0 (-1)*W*dKn];
> B = [cos((beta*d)+C) sin((beta*d)+C) 1
> 0;...
> -1*beta*sin((beta*d)+C) beta*cos((beta*d)+C) -1*alpha1
> 0;...
> cos((-1*beta*d)+C) sin((-1*beta*d)-C) 0
> sinh(alpha2*hs);... -1*beta*sin((-1*beta*d)+C)
> beta*cos((-1*beta*d)-C) 0 alpha2*cosh(alpha2*hs)];
>
> fun1 = det(A);
> fun2 = det(B);
> So, i have to solve the above 2 functions fun1, fun2 simultaneously
> and need to get an expression for resonant frequency,f. If anyone
> me..Thanking You

You seem to have some mistakes in your program, I was not able to run it.

But in any case, I suppose you want to solve for f and nu. I imagine
that there is no analytic solution. So I suggest that, once you have
fixed the mistakes, you generate a function handle via matlabFunction,
and use fsolve to solve it numerically. You should probably redefine
your symbolic vector to be x, with components f = x(1) and nu = x(2).
There is an example of what I mean here:
http://www.mathworks.com/help/optim/examples/using-symbolic-mathematics-with-optimization-toolbox-solvers.html

Good luck,

Alan Weiss
MATLAB mathematical toolbox documentation