## using Isolate in RootFinding...

Asked by:

In using Isolate in RootFinding to compute roots of a real polynomial, the output contains, say, z= some number.  How to get rid of the "z =" so that I can declare that "some number" to be some variable?

## First positive solution of trigonometric sys of eq...

Asked by:

I want to find the first positive solution of the system of trigonometric equations inside the loop.

The solutions are in the form of "d=number*_Z +number" but I need one exact solution to use it for next run of the loop.

restart;
L[0]:=0:
for i from 1 by 1 to 3 do
assume(0<d[i], d[i]<1):
assume(-0.01<a[i], a[i]<0):
L[i]:= L[i-1]+ d[i]:
sys[i]:={Re((-80*Pi*I*a[i]/((a[i]+1)^3))*exp(4*Pi*I*L[i])) = -0.4, Im((-80*Pi*I*a[i]/((a[i]+1)^3))*exp(4*Pi*I*L[i])) = 0.8}:
solve(sys[i], {a[i],d[i]}, useassumptions = true,AllSolutions=true):
end do;

These are the solutions:

d[1] = 0.03689590440 + 0.5000000000 _Z1

d[2] = -1.000000000 d[1] + 0.03689590440 + 0.5000000000 _Z2

d[3] = -1.000000000 d[1] - 1.000000000 d[2] + 0.03689590440 + 0.5000000000 _Z3

## Getting more than one result from solve...

Asked by:

Greetings Sirs,

I have recently aquired Maple for some mathematics, and being a new user, I basically google for everything at the moment.

While it has gone well so far, I seem to have hit a bump that I cannot figure out.

I have a function: f(x)=3.2+0.4sin(1.25x), 0<x<5

Trying to find the places where "f(x)=3.5" would normally be done with the equation "3.5=3.2+0.4sin(1.25x)", and when I solve for the equation in Maple I get a solution too.

Problem is though, I know there is supposed to be multiple solutions. Having used wolframalpha, and being capable of seeing the plot in Maple, I know there is two points within the period "x=0..5" that is the solution.

But when I try to solve the equation, I get only one solution per solve, and the second solve doesn't make much sense for me. These are what I use:

As you can see, in the first solve the entire function is being taking into consideration, yet I only get one solution... In the second solve I have tried specifying a period, but I still only get one solution.

Basically any help here is appreciated, because from what I understand, having read google, the solve command or fsolve command is supposed to give multiple results if they are there.

With appreciation,
Ciesi

(Edit: Image size changed)

## fsolve dont solve correctly ...

Asked by:

when i want to get awenser i have to solve it for 36 equation and 36 variabales
but maple will not give me a solution (just toss me back my variabales ) i dont know whats wrong
it will give me an awenser for lower like 20equ and 20var ?
parameters :

there is m for power an equation (equation^m) its between 2 , 2.5 , 3 , 4
and N give 2N+2var and 2N+2equ
its a hard calculation i copy it here hope u get it

h= "a number "

p := proc (x) c[-N-1]*x^2+1 end proc

dp := diff(p(x), x)

ddp := diff(p(x), x, x)

DELTA2 := piecewise(k <> j, -2*(-1)^(j-k)/(j-k)^2, k = j, -(1/3)*Pi^2)/h^2

DELTA1 := piecewise(k <> j, (-1)^(j-k)/(j-k), k = j, 0)/h

DELTA0 := piecewise(k <> j, 0, k = j, 1)

PHI := proc (x) ln(sinh(x)) end proc

dPHI := diff(PHI(x), x)

ddPHI := diff(PHI(x), x, x)

for i from -N-1 to N do x[i] := ln(exp(i*h)+(exp(2*i*h)+1)^(1/2)) end do

variabales : c[-N-1],c[-N],c[-N+1]...c[N-1],c[N] total 2N+2 var

My equations

POL := seq(simplify(eval(sum(c[k]*((eval(2*dPHI*DELTA1), x = x[j])+eval(x[j]*ddPHI*DELTA1, x = x[j])+x[j]*(eval(dPHI^2, x = x[j]))*DELTA2), k = -N .. N)+eval(ddp, x = x[j])+2*(sum(c[k]*(eval(x[j]*dPHI*DELTA1, x = x[j])+DELTA0), k = -N .. N)+eval(dp, x = x[j]))/x[j]+(c[j]*x[j]+p(x[j]))^m, x = x[j])), j = -N-1 .. N)

solving

K := fsolve({seq(POL[v] = 0, v = 1 .. 2*N+2)})

it can calculate for m=2.5 , N=15 , h=0.29669

if you can calculate it for m=3 , N=17 , h=0.41600

## Kernel connection lost...

Asked by:

Regarding my recent question http://www.mapleprimes.com/questions/221909-How-To-Extract-Data-From-Implicit-Function I would like to share an interesting observation. Here the code of the program:

```restart;
R0 := ln(y)+Re(Psi(1/2+(2*(p^2+(1/2)*sqrt(2*I+4*ksi_fs^2*p^2)*tanh(sqrt(2*I+4*ksi_fs^2*p^2)*x)/(tau+0.5e-2*a)))/y))+gamma+2*ln(2)
tau:= 10.000:ksi_fs:=10:p:=0.037:
R0p:= unapply(R0, [a,x]):
R0f:= proc(a,x)
local r:= fsolve(R0p(a,x), y= 0..1);
`if`(r::float, r, Float(undefined))
end proc:
M:= Matrix(
(100,100),
(i,j)-> R0f(i, 1 + (j-1)*(0.5-0)/(100-1)),
datatype= float[8]
);```

After approximately 2 hours of calculations I get a message window

But I repeat this calculations on another computer with the same Windows 7 64 bit and Maple 17 I don't get such error and I obtain desired data.

So can Maple be sensitive to the hardware?

## problem with higher order equations roots...

Asked by:

hey guys ,

i have problem to obtain roots for a higher order equation

thanks for your helppp.mw

## How do I find all the solutions to a trigonometric...

Asked by:

Hello,

I have just started using Maple, and it seems very powerful. I am trying to solve trigonometric equations and get all the solutions in a range, but when I use fsolve I only get one solution.

Is this by design of the function or is there another way to do this?

Tom

Asked by:

 >
 >
 (1)
 >
 (2)
 >

Download y(x).mw

## Error with Analytic()...

Asked by:

Hi!

I am an error with the use of the function "Analytic" of the packpage RootFinding. These are the procedures:

CreaCos := proc (C, n, m, t) local k, F; F := C[1][1]+(C[1][2]-C[1][1])*t; for k to n-1 do F := F, C[k+1][1]+((1/2)*C[k+1][2]-(1/2)*C[k+1][1])*(1-cos(Pi*m^k*t)) end do; return F end proc;

Then, for k=50, 100, 150... the instruction

works correctly. However, for higher values of k (for instance, k=250) returns the below error. Some idea or suggets about occurs this error?

Many thanks for your time!

Error, (in RootFinding:-Analytic) unable to evaluate `@`(evalf, proc (x) option remember; table( [( 0.524900000000000000000000000000e-1+Float(undefined)*I ) = Float(undefined)+Float(undefined)*I ] ) 31250*Pi*sin(62500*Pi*x)/(7/18-(1/2)*cos(62500*Pi*x)) end proc) at the value 0.524900000000000000000000000000e-1+Float(undefined)*I. The expression to be solved was probably not analytic.

## modified regular falsi method...

Asked by:

hy
need help
i made this code but i can not get the answer ,help me to find out where i did wrong.

thanx in advance

restart;
f:=x->(x^3+3*x^2-1);
n:=30;
tol:=1e-9;
a[0]:=0;
b[0]:=10;
Digits :=15;

printf("No root F(x) abs(x[i+1]-x[i])\n");

for i from 1 to n do
t[i-1] :=evalf( (b[i-1]-a[i-1])/(f(b[i-1])-f(a[i-1])));
c[i-1] := evalf((a[i-1]*f(b[i-1])-b[i-1]*f(a[i-1]))/(f(b[i-1])-f(a[i-1])));
x[i] :=evalf( x[i-1]-t[i-1]*f(x[i-1])^2/(f(x[i-1])-f(c[i-1])));

printf("%d %10.15f %10.15f %10.15e \n",i,x[i],f(x[i]),abs(x[i]-x[i-1]));
if f(a[i-1])*f(c[i-1])<0 then
a[i]:=a[i-1];
b[i]:=c[i-1];
else
a[i]:=c[i-1];
b[i]:=b[i-1];
if abs(f(x[i]))<tol then
print("approximate solution"= x[i]);
print("No of iterations"= i);
break;
end if;
end if;
end do:

## how to make faster the code for solving a nonlinea...

Asked by:

Running the code costs a lot of time, I need some suggestions to make faster and more accurate. Thanks!

sonkok.mw

## convergence of newton method...

Asked by:

how i can find order of convergence of newton method by expanding taylor series?? plz send me code???

## Finding the root corresponding to maximum absolute...

Asked by:

Hi,

I have to find the root of an equation corresponding to the maximum absolute value. I am using root finding package to get all the roots. But after getting all the roots i am not able to apply abs function. Maple sheet is attached.

 >
 >
 >
 >
 >
 >
 (1)
 >
 >
 >
 >
 (2)
 >
 (3)
 >
 >
 (4)
 >
 >
 (5)
 >
 >
 (6)
 >
 (7)
 >
 >

Download question.mw

I will be really thankful for the help.

Regards

Sunit

## How to find root for equation with 'w'?...

Asked by:

Here, I attached my maple code. I need to find root. I am using fsolve. But I am not geting the root. Please any one help me... to find the root.

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)
 >
 (8)
 >
 (9)
 >
 (10)
 >
 (11)
 >
 (12)
 >
 (13)
 >
 (14)
 >
 (15)
 >
 (16)
 >
 (17)
 >
 (18)
 >
 (19)
 >
 (20)
 >
 (21)
 >
 (22)
 >
 (23)
 >
 (24)
 >
 (25)
 >
 (26)
 >
 (27)
 >
 (28)
 >
 (29)
 >
 (30)
 >
 (31)
 >
 (32)
 >
 (33)
 >
 (34)
 >
 (35)
 >
 (36)
 >
 (37)
 >
 (38)
 >
 >
 (39)
 >

Download root.mw

## RootFinding[Isolate] vs solve...

Asked by:

For solving polynomial systems I used RootFinding[Isolate]. But after discussing the question http://www.mapleprimes.com/questions/211774-Roots-Of--Expz--1
I decided to compare Isolate and evalf(solve ([...], [...])). It seemed to me that solve some convenient. The only if in the equation there are integers as a real, they should be recorded with a decimal point. (For real solutions of this procedure should be used with (RealDomain).)  Examples:

SOLVE_ISOLATE.mw

I wonder why then the need Root Finding [Isolate]?

 1 2 3 4 Page 1 of 4
﻿