Items tagged with rootfinding rootfinding Tagged Items Feed

Hi, I am using Maple 18 and struggling with plotting Newton's Method.

I am wanting use the function f(x)=x^3 +cx + 1 where c is a parameter and uses 100 parameter values between -2 and 0, with 100 iterations of each parameter.

Any help would be brilliant.

Thanks in advance,

Neil

I am numerically solving a nonlinear system of nine equations. How long can I expect it to take?

I have run it for 30 minutes and it has not solved yet.

Here is the system of equations:

0=Lambda-mu.*S-beta.*(H+C+C1+C2).*(S./N)-tau.*(T+C).*(S./N);

0=tau.*(T+C).*(S./N)-beta.*(H+C+C1+C2).*(T./N)-(mu+mu_T).*T;

0=beta.*(H+C+C1+C2).*(S./N)-tau.*(T+C).*(H./N)-(mu+mu_A).*H;

0=beta.*(H+C+C1+C2).*(T./N)+tau.*(T+C).*(H./N)-(mu+psi.*mu_A+mu_T+lambda_T).*C;

0=lambda_T.*C-(mu+mu_A+rho_1+eta_1).*C1;

0=rho_1.*C1-(mu+mu_A+rho_2+eta_2).*C2;

0=eta_1.*C1-(mu+rho_1+gamma).*CT1;

0=eta_2.*C2-(mu+rho_2+gamma.*(rho_1)./(rho_1+rho_2)).*CT2+(rho_1).*CT1;

0 = N - S - T - H - C - C1 - C2 - CT1 - CT2;

and I have numeric values for Lambda, beta, tau, mu, mu_T, mu_A, rho_1, rho_2, psi, gamma. The only parameters left are eta_1, eta_2.

Thank you.

Let's say I have 2 functions, the first being y=sin^2(x) and the second one is y=e^(-x)cos(x). When I try to solve on Maple, it only gives me one intersecting point, while I would like to see ALL intersections between the 2 functions. How would I go about doing this?

To motivate some ideas in my research, I've been looking at the expected number of real roots of random polynomials (and their derivatives).  In doing so I have noticed an issue/bug with fsolve and RootFinding[Isolate].  One of the polynomials I came upon was

f(x) = -32829/50000-(9277/50000)*x-(37251/20000)*x^2-(6101/6250)*x^3-(47777/20000)*x^4+(291213/50000)*x^5.

We know that f(x) has at least 1 real root and, in fact, graphing shows that f(x) has exactly 1 real root (~1.018).  However, fsolve(f) and Isolate(f) both return no real roots.  On the other hand, Isolate(f,method=RC) correctly returns the root near 1.018.  I know that fsolve's details page says "It may not return all roots for exceptionally ill-conditioned polynomials", though this system does not seem especially ill-conditioned.  Moreover, Isolate's help page says confidently "All significant digits returned by the program are correct, and unlike purely numerical methods no roots are ever lost, although repeated roots are discarded" which is clearly not the case here.  It also seems interesting that the RealSolving package used by Isolate(f,method=RS) (default method) misses the root while the RegularChains package used by Isolate(f,method=RC) correctly finds the root.

 All-in-all, I am not sure what to make of this.  Is this an issue which has been fixed in more recent incarnations of fsolve or Isolate?  Is this a persistent problem?  Is there a theoretical reason why the root is being missed, particularly for Isolate?

Any help or insight would be greatly appreciated.

Hey, 

I am trying to write a single procedure to find the root of any function using the Newton-Raphson method, given the initial approximation and the tolerance. If this fails to converge, the program must then use the Bisection method to find the root. Need some help please. The current procedure i have done is only coming out with the first Iteration 

Thanks for the help!

Hi, 

 

I wish to be able to calculate the roots of the function f(p) by using the roots of the function h(p) and applying the bisection method due to the fact that the roots of h(p) bracket the roots of f(p) as can be seen in the graph below. I have done this before for another example when h:=J0(p); and hence i could use The commands BesselJZeros(0,n)/BesselJZzeros(0,n+1) to find the roots. So my problem arises with the finding the roots of h(p) and how to insert them into my bisection loop(underlined below).

Any advice would amazing. Many thanks


restart;

Digits := 30:
with (plots):
with(RootFinding):

#Define given parameters

R:=1: #external radius of particles, cm

d:=10^(-3): #diffusivity cm^2 per second

alpha:= 1: #fractional void volume

c0:=10^(-6): #concentartion of soltion in void volume of solid initially, moles per liter

C0:=0: #concentration of main body of solution initially, moles per liter

k1:=0.5: #constant in adsorption isotherm (ka)

k2:=0.75: #constant in adsorption isotherm (kd)

k:=2.5: #equilbrium constant for adsorption kinetics

n0:=(k1/k2)*c0:#initial amount absrobed on solid, moles per liter

V:=0.1: #volume of external solution, liters

W:=0.1: #weight of absorbant, grams

rho:=2.0: #solid aparrant density, g/cc

delta:=(1/d)*((p+alpha*k2+k1)/(p+alpha*k2));

beta:=W*alpha*d/(rho*V);

   

1000*(p+1.25)/(p+.75)

 

0.500000000000000000000000000000e-3

 

 

 

 

 


f:=p->(BesselJ(0,R*sqrt(-delta*p))*k*p-(R*sqrt(-delta*p))*BesselJ(1,R*sqrt(-delta*p))*(d*p/R + 2*beta*k/(R^2)));

proc (p) options operator, arrow; BesselJ(0, R*sqrt(-delta*p))*k*p-R*sqrt(-delta*p)*BesselJ(1, R*sqrt(-delta*p))*(d*p/R+2*beta*k/R^2) end proc

(2)

h:=p->(BesselJ(0,R*sqrt(-delta*p)));
plot([f(p),h(p)],p=-0.3..0,axis=-5..5,legend=["f(p)","h(p)"]);


 




proc (p) options operator, arrow; BesselJ(0, R*sqrt(-delta*p)) end proc

 

 

 

(3)



points:=5:
rts:= Array(1..points):
for n from 1 by +1 to points do
pl:=evalf(#**first root of h**);
pu:=evalf(#**second root of h, i.e n+1 root**);
pe:= (pl+pu)/2;
while abs(f(pe))>10^(-6) do
pe:=(pu+pl)/2;
if f(pu)*f(pe) <0 then
pl:=pe;
elif f(pl)*f(pe)<0 then
pu:=pe;
end if;
od;
rts[n]:=pe;

od;
rts[n]:=p[n];

 

 

Download spherical_continue.mw


 

Download spherical_continue.mw

hi everybody

I want to solve this system of equations


t*((p-.764*z-2.194768)^2-1.170308549+.529948*(z-.382)^2)-(1-t)*p
t*((p+.382*z+.661624*y-1.907568)^2-1.018097144+.529984*(-.866*y-.5*z-.382)^2)+(1-t)*y
t*((p+.382*z-.661624*y-2.470348)^2-1.31636154+.529984*(.866*y-.5*z-.382)^2)+(1-t)*z


while t varies from 0 to 1 by 0.0001 interval. Using newton raphson method, the inital value for each step is the result of the previous step for y,z,p. the very initial values are y=1,z=1,p=1


please help me. Thanks

eq1 := y=−26.21231979∗z+15.42332896+13.22411533∗e−.6786000000∗x

eq2 := y=−25.98077423∗z+14.81943362+13.53858145∗e−.6569000000∗x

# Comparing both equations, eliminating y

# Putting z= 0.5044

fsolve(eval(rhs(eq1) = rhs(eq2), z = .5044))

I even done manually as well

-26.21231979*(0.5044)+15.42332896+13.22411533*e^(-.6786000000*x) =
 -25.98077423*(0.5044)+14.81943362+13.53858145*e^(-.6569000000*x)

I cannot find x value?  

But it doesn't evaluate the value of x. Any other solution.

Edit : My main task is to calculate value of x by putting any value of z This is just an example

Hello,

I am trying to find all the roots of this equation and to solve it:

exp(x)*cos(x)+1=0

but doing fsolve(exp(x)*cos(x)+1,x=0..10) it gives me only one solution, while I know that there is more than one solution. How can I do in order to solve this equation and have all the roots in the range 0..10?

I really can't figure it out!

Thank you

 

Giulia

Hi,

I need help for the following,

Good morning sir,

 

I request you to help me out to solve the equations by using Muller Method & Horner's method using Maple.

 

With thanks & regards

 

M.Anand

Hi, I'm trying to find the first ten roots of the equation:

sin(a*Pi)*sqrt(4*a^2+3)*cos(sqrt(4*a^2+3)*Pi)+sin(sqrt(4*a^2+3)*Pi)*a*cos(a*Pi) = 0

But fsolve only finds one root, and not necessarily the first one. So I'm having a difficult time getting the first 10 roots without preknowledge of the intervals to search in. (I can obviously plot it, but there are some other parameters which affect this equation and I can't manually find the intervals every time I change them).

Hi,

This is for a code that analyzes composite laminates with many plys of varying orientation stacked on top of each other, and this is the first semester I've used Maple.

I'm solving for the roots of an equation which will always have a positive and a negative root, and I do this for each ply (could be 100 plies in a laminate).  I want to collect the positive root for each ply, put them in a list or array, and then pick out the smallest value of all the plies ...

In my complex root finding problem it is essential to obtain complex roots in each period of the function. to do this i have write the following code with functional periods but it doesnt work. would you please tell me why? and how can i correct the code?

I am trying to find the complex roots of a nonlinear function within a region using Rootfinding:- Analytic. The problem is that with exactly the same function, the same parameters, etc. it sometimes finds all the roots and sometimes does not! Does anyone know why?

1 2 Page 1 of 2