JMathLabTutorial:Equations (Nonlinear)

From jWork.ORG
Revision as of 20:24, 27 December 2016 by Jworkorg (talk | contribs) (Nonlinear Equations)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Limitted access. Reguest membership or login to this link first if you are already a member
Contents


Nonlinear Equations

"Equation" in the following means the equation expression = 0. Equations are solved for a symbolic variable x by the function solve(expression, x). If expression is a quotient, then nominator = 0 is solved. It uses the following strategy to solve equations:

  • Unordered List ItemFirst, all occurrences of the variable x in expression
  • are counted, both as free variable and embedded inside functions. Example:
  • In [math]x^3\cdot\sin(x)+2x^2-\sqrt{x-1}[/math] x occurs three times: as free
  • variable, in [math]\sin(x)[/math] and in [math]\sqrt{x-1}[/math].
  • Unordered List ItemIf this count is one, then we are dealing with a
  • polynomic equation, which is solved for the polynomial's main variable,
  • e.g. z. This works always, if the polynomial's degree is 2 or of it is
  • biquadratic, otherwise only, if the coefficients are constant. In the next
  • step the solution is solved for the desired variable x. As an example:
  • One can solve [math]\sin^2(x)-2\sin(x)+1=0[/math] for "x". It first solves
  • [math]z^2-2z+1=0[/math] for $z$ and then [math]\sin(x)=z[/math] for "x". Examples with free
  • variables:


syms x,b
a=solve(x^2-1,x)     
printf('%f\n',a)
a=solve(x^2-2*x*b+b^2,x)
printf('%f\n',a)

An example with function variable ([math]\exp(j\cdot x)[/math]):


syms x
a=float( solve(sin(x)^2+2*cos(x)-0.5,x) )  
printf('%f\n',a)

  • Unordered List ItemIf count is 2, only one case is further considered: The
  • variable occurs free and inside squareroot. This squareroot is then
  • isolated, the equation squared and solved. This case leads to additional
  • false solutions, which have to be sorted out manually.


syms x
y=x^2+3*x-17*sqrt(3*x^2+12);
a=solve(y,x)
printf('%f\n',a)

  • Unordered List ItemIn all other cases Jasymca gives up.