Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

matlab equation !!!! solve('tan(2.6433*x)=(1-x^2-(3.4/3.66)^2)^.5/x')

Status
Not open for further replies.

W_Heisenberg

Full Member level 4
Full Member level 4
Joined
Feb 27, 2011
Messages
217
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,298
Location
Boston
Visit site
Activity points
2,575
the equation as follows:
tan(2.6433*x)=(1-x^2-(3.4/3.66)^2)^.5 /x

this should not be so hard to solve by matlab, but matlab never gives me anwser, anyone knows why?

my codes :
solve('tan(2.6433*x)=(1-x^2-(3.4/3.66)^2)^.5/x')
 

It could be your variable 'x' isn't in the default variables. Try to specify the variable using solve(expr,var), that is:

solve('tan(2.6433*x)=(1-x^2-(3.4/3.66)^2)^.5/x',x)

or try enabling the symbolic solver:

syms x
solve('tan(2.6433*x)=(1-x^2-(3.4/3.66)^2)^.5/x')
 

the equation as follows:
tan(2.6433*x)=(1-x^2-(3.4/3.66)^2)^.5 /x

this should not be so hard to solve by matlab, but matlab never gives me anwser, anyone knows why?

my codes :
solve('tan(2.6433*x)=(1-x^2-(3.4/3.66)^2)^.5/x')

Rewrite your equation for some "numerically friendly" (avoiding square root)

tan(2.6433*x)^2 = (1-x^2-(3.4/3.66)^2)/x^2

x = 0.2759735729
 

Wow, buddy

Square root should be avoided in matlab?

Is this your suggestion for all the equations? or only this one?

Besides, thanks for your help !!!!
 

Wow, buddy
Square root should be avoided in matlab?
Is this your suggestion for all the equations? or only this one?

When solving something for numerical methods you have to be careful with the function domain, because if an iteration falls outside (eg. complex values in real function, division by zero or near zero , etc ​​), the software will have to do special handling of that situation.

With sqrt that occurs on negative values​​, as often the treatment given by the software is unknown, the alternative is modify (if possible) the equation.

In the previous message I did not have near a PC with Matlab installed and try with Derive6.
With tan(2.6433*x) = (1-x^2 - (3.4/3.66)^2)^.5/x does not converge
but (tan(2.6433*x))^2 = (1-x ^ 2 - (3.4/3.66)^2)/x^2
or (x*tan(2.6433*x))^2 = 1-x^2 - (3.4 / 3.66)^2 works fine


Minutes ago I did with Matlab and solve always fail (I don't know why) :sad:
With fsolve(funct, x0) converges in all ways, but only with initial values ​​(x0) relatively close to the root.
 

I actually failed thousands of times. It keeps saying left of equal sign cant be assigned.

Man, your explaination makes sense. I do believe this is a problem of the codes.

I mean, it could be the software engineer defined the domain in a certain range. In order to use the function properly, we should read the mannual carefully.

In fact, originally my question is a function of x, rather this x = cos(z), and solving for z.

It is worse if I do not use x to represent cos(z). Nonlinear equations codes could be even more complex.

Yet now, I really thank you, buddy. With your help, I finally could solve something.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top