Items tagged with fsolve

With the following command I can plot two spheres and plot them.

f1 := x^2+y^2+z^2 = 1

f2 := x+y+z = 1



S1 := implicitplot3d(f1, x = -1 .. 1, y = -1 .. 1, z = -1 .. 1, style = patchnogrid, color = blue, scaling = constrained, axes = boxed)

S2 := implicitplot3d(f2, x = -1 .. 1, y = -1 .. 1, z = -1 .. 1, style = patchnogrid, color = gold, scaling = constrained, axes = boxed)


My questions are:

1- How can I display (highlight) the circle which is the intersection between these two sphere on the same figure?

2- How can I find the equation of this circle?

Thank you.



I have a system of equations (4) which I would like to plot in regards to a fifth variable. Is there a good way to do this. Some of the solutions would end up as negative values, which is not an option I am interested in having.


C__A is my variable, and the other variables I would like to solve are tau,C__B,C__C,C__D. Im specifically interested in tau with regards to C__A. I hope this makes sense :)



C__A := .75;

a := tau = (C__A0-C__A)/(-r__A);
    tau = - ------------------------------------------------
            -0.00900 C__B + 0.03500000000 C__C  - 0.075 C__C
b := tau = (C__B0-C__B)/(-r__B);
                               2 - C__B              
          tau = - -----------------------------------
                  -0.00900 C__B + 0.03500000000 C__C 
c := tau = (C__C0-C__C)/(-r__C);
         tau = ---------------------------------------
               0.01800 C__B - 0.070 C__C  - 0.075 C__C
d := tau = (C__D0-C__D)/(-r__D);
                           13.33333333 C__D
                     tau = ----------------
sol := fsolve([a, b, c, d], {C__B = 1, C__C = .2, C__D = .2, tau = 50});

{C__B = 1.673672109, C__C = 0.2289836744, C__D = 0.4236721086, 

  tau = 24.66971264}


I've encountered a very strange issue with Maple.

The result returns differently with solve and fsolve after/before a variable is given a certain value. See attachment.

The result comes from solve (with variable epsilon) returns value of the same variable with imaginary part while the fsolve returns the correct answer.

Now how can I achieve the same result as fsolve via solve?


Maple_Question_Solve_Fsolve.pdf  (exported PDF from Maple)

I have trouble solving this equation


fsolve(5000 = int(1/(0.1060444429e-1-0.2120888857e-1*X+0.1033933318e-1*X^2), X = 0 .. x), x)

It has a few points where the solution will go towards infinite, but that is not something that is an issue normally. I have no problems what so ever to solve this using my trusty TI-89, so Im wondering what needs to be done to actually solve this. I have tried giving an initial guess, and I have tried using solve, but it doesnt seem to do the trick.




I've made a system of two equations:

eq1:= x^2+y^2=0.314

eq2:= y=0.05180967688x

The first is a circle while the second is a line. I use the command fsolve in order to get the intersection and i get:


I need to use these results as the coordinates of a pointplot, how can i do it? Is there a way to isolate x and y?


Hello everyone,

I have 5 equations (fa,fb,fc,fk,fv) and 5 variables (V0,A0,A1,A2,k1) and I want to solve them numerically. Problem is my inability to set properly intervals and starting values. 

Here is my command: fsolve({fa,fb,fc,fk,fv},{V0,A0,A1,A2,k1});

If I run it just like this, I get some values, lets say V0=0.00045 etc.But when I set range for V0 like this:


I get this:

Error, (in fsolve) fsolve cannot solve on V0 = 0.4e-3 .. 0.5e-3

I used interval 0.0004..0.0005 only to prove that there must be the wrong syntax, because obviously 0.0004<0.00045<0.0005. In reality i need interval 0.0001..0.0002 and it is also set some initial values (A0=0.0023) but first I need to solve my problem with syntax.

Any advice ?

It is well known that fsolve usually increases (internally) Digits in order to obtain the desired accuracy.

But in the following example, it seems that fsolve highly exaggerates :-)   


Error, (in fsolve) Digits cannot exceed 38654705646

Note that the bug does not appear if e.g. F:=expand(mul(x-k-I, k=1..N)):



I solve a set of equations in this way and I have three set of answers ,but I don`t know wich one is true.

and I have another question ,how can I assume v[0] like a constant?


alpha[2]:= 2.727272728*10^5: alpha[4]:= 3738.685337: alpha[6]:= -30.18675539: alpha[7] := -4.116375735*10^6: alpha[8] := 1.859504132*10^10: alpha[9]:= 2.489142857*10^(-12):

l10:=(alpha[7]*v[0]^2+1)*gamma[i*n]^4+(-alpha[4]*beta[n]^2+alpha[8]*v[0]^2-alpha[9])*gamma[i*n]^2+(2*I)*gamma[i*n]*alpha[2]*beta[n]*v[0]+(2*I)*gamma[i*n]^3*alpha[6]*beta[n]*v[0]-beta[n]^2 = 0:

l11 := subs(i = 1, l10);

l12 := subs(i = 2, l10);

l13 := subs(i = 3, l10);

l14 := subs(i = 4, l10);

l15 := (exp(I*(gamma[n]+gamma[2*n]))+exp(I*(gamma[3*n]+gamma[4*n])))*(gamma[3*n]^2-gamma[4*n]^2)*(gamma[n]^2-gamma[2*n]^2)+(exp(I*(gamma[n]+gamma[4*n]))+exp(I*(gamma[2*n]+gamma[3*n])))*(gamma[2*n]^2-gamma[3*n]^2)*(gamma[n]^2-gamma[4*n]^2)+(exp(I*(gamma[2*n]+gamma[4*n]))+exp(I*(gamma[n]+gamma[3*n])))*(gamma[2*n]^2-gamma[4*n]^2)*(-gamma[n]^2+gamma[3*n]^2) = 0;

l1 := combine(expand(evalc(l15)), trig):

l2 := combine(expand(evalc(Re(l15))), trig):

l3 := combine(expand(evalc(Im(l15))), trig): v[0] := 1; 1

fsolve({l1, l11, l12, l13, l14}, {beta[n], gamma[n], gamma[2*n], gamma[3*n], gamma[4*n]}):

fsolve({l11, l12, l13, l14, l2}):

solve({l11, l12, l13, l14, l3}):



Here is one that the students generated which caused confusion. 

a := 0.76;
eq1 := 2*cot(a*sqrt(2*E)) = (2*E-5.4)/(sqrt(E*(5.4-E));
solve(eq1, E)

And the results are: 0., 4.411954070, 2.423743792

The problem is with the second answer because it does not exist. If we plot the LHS and the RHS of eq1 vs E where E=0..5.4

plot([2*cot(0.76*sqrt(2*E)), (2*E-5.4)/sqrt(E*(5.4-E))], E=0..5.4, -3..3)

And it gets more interesting, if we calculate:

solve(evalf(eq1), E)

The answers are: 0., 2.423743793, 14.33807304+27.39159712*I

where the 3rd answer is again incorrect.

Finally, if a = 0.8 or larger, the incorrect answers disappear. 

Note - fsolve does handle this problem correctly. And despite my attempts to remind them to use fsolve, they see the solve command as the universal truth. Apparently this will be another teaching moment for next year.

So any thoughts about why this happens and why there is a difference in the outcomes between 0.76 and 0.8 for the value of a?


hi .how i can fsolve 8 equations, in which obtained from

for k from 2 to m do eq1[k_] end do


for k from 2 to m do eq2[k_] end do  and so on........

And gain unknown functions as f3[2], f4[4],....



 ############################Define some parameters


restart; Digits := 15; n := 1; m := 3; len := 1; h := len/m; nn := m+1
 ############################Define some equation

eq1[k_] := -3.0*h*(-f2[k]*f1[k-1]+f2[k]*f1[k+1]+f1[k]*(-f2[k+1]+f2[k-1]))*f4[k]^2+((-8.0*f1[k]+4.0*f1[k-1]+4.0*f1[k+1])*f3[k]+(-f1[k+1]+f1[k-1])*(-f3[k+1]+f3[k-1]))*f4[k]-f3[k]*(-f1[k+1]+f1[k-1])*(-f4[k+1]+f4[k-1]):





                                     ######################################  APPLY BOUNDARY CONDITIONS

f2[0] := f2[2];



``for k from 2 to m do eq1[k_] end do



for k from 2 to m do eq2[k_] end do



for k from 2 to m do eq3[k_] end do



for k from 2 to m do eq4[k_] end do





Download i can solve or fsolve this equations?

i can not with fsolve?

thanks alot

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/ .




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? 



i need to find the graph of exp(v(r)) from 0 to 2e6.

i obtained the graph of v(r) by taking log but how to obtained in exp form


I can't make maple solve this equation, any help please


please help me for fsolve algebric equations...






U1:=diff(theta(eta), eta, eta)-3*Omega(eta)*(F(eta)*(diff(theta(eta), eta))-theta(eta)*(diff(F(eta), eta)))/(2*K(eta))+((diff(K(eta), eta))/K(eta)-(diff(Omega(eta), eta))/Omega(eta))*(diff(theta(eta), eta)) = 0:U2:= diff(F(eta), eta, eta, eta)+Omega(eta)*(3*F(eta)*(diff(F(eta), eta, eta))-(diff(F(eta), eta))^2)/(2*K(eta))+((diff(K(eta), eta))/K(eta)-(diff(Omega(eta), eta))/Omega(eta))*(diff(F(eta), eta, eta))+Omega(eta)/K(eta) = 0:U3:= diff(K(eta), eta, eta)+Omega(eta)*(1.5*F(eta)*(diff(K(eta), eta))-K(eta)*(diff(F(eta), eta)))/K(eta)+((diff(K(eta), eta))/K(eta)-(diff(Omega(eta), eta))/Omega(eta))*(diff(K(eta), eta))+(diff(F(eta), eta, eta))^2-Omega(eta)^2 = 0:U4:= diff(Omega(eta), eta, eta)+Omega(eta)*(3*F(eta)*(diff(Omega(eta), eta))+Omega(eta)*(diff(F(eta), eta)))/(2*K(eta))+((diff(K(eta), eta))/K(eta)-(diff(Omega(eta), eta))/Omega(eta))*(diff(Omega(eta), eta))+Omega(eta)*(diff(F(eta), eta, eta))^2/K(eta)-Omega(eta)^3/K(eta) = 0:





s1:=F(eta)(0) = 0:

s2:=K(eta)(0) = 0:s3:=Omega(eta)(0) = 0:s4:=theta(eta)(0) = 1:s5:=theta(eta)(1) = 0:s6:=(D(F(eta)))(0) = 0:s7:=(D(K(eta)))(1) = 0:s8:=(D(Omega(eta)))(1) = 0:s9:=((D@@2)(F(eta)))(1) = 0

20*a[5]+12*a[4]+6*a[3]+2*a[2] = 0


s10:=U1(0):s11:=U2(0):s12:=U3(0):s13:=U4(0):        s14:=U1(1):s15:=U2(1):s16:=U3(1):s17:=U4(1):    s18:=D(U1)(0):s19:=D(U2)(0):s20:=D(U3)(0):s21:=D(U4)(0):     s22:=D(U1)(1):s23:=D(U2)(1):s24:=D(U3)(1):





Error, invalid input: eval received S, which is not valid for its 2nd argument, eqns



Error, invalid input: eval received S, which is not valid for its 2nd argument, eqns



Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct



Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct






1 2 3 4 5 6 7 Last Page 1 of 13