Items tagged with fsolve fsolve Tagged Items Feed

i want to solve an equation by fsolve but i cant assign a value as an input for next step!

please help me

s := fsolve(G), x = -1 .. 1     

s := .1449607418, x = -1 .. 1  

 a:=s+1  

Error, invalid input: subs received .1449607418, which is not valid for its 1st argument                  

 

I want to solve system of equation but it has unknow parameter.

Then I test system of equation. It hasn't unknowparameter.

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

eq2 := y-x^2 = 0

fsolve({eq1, eq2}, {x, y})

{x = -1.249621068, y = 1.561552813}

So I get answer by using fsolve.

 

Then I try to put unknow parameter in system of equation.

eq3 := x^2+ky^2 = 4

eq4 := ay-hx^2 = 0

fsolve({eq3, eq4}, {x, y})

Error, (in fsolve) {ay, hx, ky} are in the equation, and are not solved for

I don't get answer and open link. The link hasn't similar this problem.

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.

Hi! I'm trying to solve a system of four non-linear equations in Maple 17 but it doesn't work.

Equations are: F, Fw, Ft, Fk and varibles are T,w,k,ki.

Parametars are Mn=10, Ms=2, alfa=0.2 and Tf=(k*T^(alfa)/Mn)^(1/alfa).

Solutions must be positive. 

This is maple script:

restart;
> assume (w>0):
> assume (T>0):
> assume (k>0):
> assume (ki>0):
> assume (Mn>0):
> assume (Ms>0):
> assume (Tf>0):
> assume (alfa>0):


> Gp:=1/exp(sqrt(w*I));

> Cf:=((T*w*I+1)/(Tf*w*I+1));

> Cpi:=(k*w*I+ki)/(w*I);

> L:=Cf*Cpi*Gp;
> L:=evalc(L):
> F:=subs(Ms=2,Tf=(k*T^(alfa)/Mn)^(1/alfa),evalc(abs(1+L)^2-1/Ms^2));
> F:=subs(Mn=10,alfa=0.2,evalc(F));

> Fw:=diff(F,w):
> Fk:=diff(F,k):
> Ft:=diff(F,T):
> fsolve({F,Fw,Fk,Ft},{w,k,ki,T});

Thanks in advance for any help. Dragoslav

i := I;

assume(a>0);

assume(b>0);

assume(r>0);

assume(k>0);

assume(w>0);

Hz := k*(z^2-2*r*a+r^2)/((z-1)*(z^2-2*b*z+1));

Hzw := eval(Hz, z = exp(i*w)); assume(a > 0);

Habs := simplify(abs(Hzw)^2);

p1 := eval(Habs, w = Pi) = (10^((-3.3018)*(1/20)))^2;

p2 := eval(Habs, w = (1/2)*Pi) = (10^((-.1758)*(1/20)))^2;

p3 := eval(Habs, w = (1/4)*Pi) = (10^(6.425*(1/20)))^2;

p4 := eval(Habs, w = (1/8)*Pi) = (10^(54.5699*(1/20)))^2;

solve({p1, p2, p3, p4})

 

Hello everybody,

I want to find all of roots of the complex variables functions in two ways.

(1) find the value which can make the function equals 0

(2) find the real value and imaginary value which make real part and imaginary part of function equal 0

(I know answers of these two case is not equal completely.)

 

The function is a non-linear function, including sin, cos and Bessel function, such as:

 


And, I used Analytic and fsolve to do case (1) and (2), but failure. The follow result is how I tried to find the real value answer:

 

It seems that both of two commands can only find some of roots. 

How to find all of roots of these cases? The related .mw file is attached.

Cannot_find_all_of_roots.mw

 

Thanks a lot.

 

Dear Friends

I have a problem in CPU time in MAPLE.

I write the codes in maple related to the nonlinear heat conduction problem in one dimension by Collocation method, but after 30 minutes no solution has been observed!!!

My codes are for N=4!, i.e., I have 25 equations with 25 unknowns!!!

If MAPLE can not solve this simple system, How can I solve 3 dimensional pdes by N=9,

In this case, I have 1000 equations with 1000 unknowns!!!

please help me and suggest me a fast iterative solver.

I should remark that my problem is stated in this paper

http://www.sciencedirect.com/science/article/pii/S1018364713000025

If there exist any other suitable method, I will be happy to receive any support.

 

With kind regards,

Emran Tohidi.

 

> restart;
> Digits := 20; N := 4; st := time(); u := sum(sum(a[m, n]*x^m*t^n, m = 0 .. N), n = 0 .. N); u := unapply(u, x, t); ut := diff(u(x, t), `$`(t, 1)); ut := unapply(ut, x, t); ku := simplify(1+u(x, t)^2); ku := unapply(ku, x, t); ux := diff(u(x, t), `$`(x, 1)); ux := unapply(ux, x, t); K := ku(x, t)*ux(x, t); K := unapply(K, x, t); Kx := diff(K(x, t), `$`(x, 1)); Kx := unapply(Kx, x, t); f := proc (x, t) options operator, arrow; x*exp(t)*(1-2*exp(2*t)) end proc;
print(`output redirected...`); # input placeholder
> S1 := {seq(u(i/N, 0)-i/N = 0, i = 0 .. N)}; S2 := {seq(u(0, j/N) = 0, j = 1 .. N)}; S3 := {seq(u(1, j/N)+ux(1, j/N)-2*exp(j/N) = 0, j = 1 .. N)}; S4 := {seq(seq(Kx(i/N, j/N)+f(i/N, j/N)-ut(i/N, j/N) = 0, i = 1 .. N-1), j = 1 .. N)}; S := `union`(`union`(`union`(S1, S2), S3), S4); sol := DirectSearch:-SolveEquations([op(S)], tolerances = 10^(-4), evaluationlimit = 1000000);
print(`output redirected...`); # input placeholder
> assign(sol);
%;
> u(x, t);
> CPUTIME := time()-st;
plot3d(u(x, t) - x exp(t), x = 0 .. 1, t = 0 .. 1)

Hy all.

I want to solve this equation, with„dd” as numerical result. What do I do wrong? Thanks. Nico

restart;
TTot := 70;
TC := 17;
GM := .26;
QMax := 870;
V := 3600*GM*QMax*TTot;
eq := V = int(QMax*exp((-t+TC)/dd)*(1+(t-TC)/TC)^(TC/dd), t = 0 .. TTot);
fsolve(eq, dd);

hello

this is my program and fsolve for low intensity solve the equations but for high intensity cannot solve why?

this is my code:

ep0 := 1/(4*3.14);

el := 8.54*10^(-2);

hbar := 1;

vf := 1/300;

kb := 1;

tem := 2.586*10^(-2);

ci := 1;

p := 1.458*10^16;

beta := 2;

ai := 7.1*10^(-4);

bi := ai/sqrt(3);

enph := .196;

d := enph/(kb*tem);

n0 := 1/(exp(enph/(kb*tem))-1);

gama := hbar*vf;

intensity:=9000000

 

w := 7.28;

impurity := 7.2*10^3;

g := hbar*beta/(bi^2*sqrt(2*p*enph));

aa := g^2*(n0+1)/(2*Pi*hbar*gama^2);

bb := g^2*n0/(2*Pi*hbar*gama^2);

cc := 2/(Pi*gama^2);

l := (1*hbar)*w/(2*kb*tem);

 

u := el^2*intensity/(32*w*hbar^2);

[fsolve({op([((enph*ln(1+exp(c+enph/(kb*tem)))/(kb*tem)-polylog(2, -exp(c))+polylog(2, -exp(c+enph/(kb*tem))))*enph*(kb*tem)^2-(enph^2*ln(1+exp(c+enph/(kb*tem)))/(kb^2*tem^2)+2*enph*polylog(2, -exp(c+enph/(kb*tem)))/(kb*tem)+2*polylog(3, -exp(c))-2*polylog(3, -exp(c+enph/(kb*tem))))*(kb*tem)^3+(-exp(b)*enph*ln(1+exp(c+enph/(kb*tem)))+exp(c+d)*enph*ln(1+exp(b-d+enph/(kb*tem)))+exp(b)*kb*tem*polylog(2, -exp(c))-exp(c+d)*kb*tem*polylog(2, -exp(b-d))-exp(b)*kb*tem*polylog(2, -exp(c+enph/(kb*tem)))+exp(c+d)*kb*tem*polylog(2, -exp(b-d+enph/(kb*tem))))*enph*(kb*tem)^2/((exp(b)-exp(c+d))*kb*tem)+(exp(b)*enph^2*ln(1+exp(c+enph/(kb*tem)))-exp(c+d)*enph^2*ln(1+exp(b-d+enph/(kb*tem)))+2*exp(b)*enph*kb*tem*polylog(2, -exp(c+enph/(kb*tem)))-2*exp(c+d)*enph*kb*tem*polylog(2, -exp(b-d+enph/(kb*tem)))+2*exp(b)*kb^2*tem^2*polylog(3, -exp(c))-2*exp(c+d)*kb^2*tem^2*polylog(3, -exp(b-d))-2*exp(b)*kb^2*tem^2*polylog(3, -exp(c+enph/(kb*tem)))+2*exp(c+d)*kb^2*tem^2*polylog(3, -exp(b-d+enph/(kb*tem))))*(kb*tem)^3/((exp(b)-exp(c+d))*kb^2*tem^2))*bb+u*(1/(1+exp(-l-c))-1/((1+exp(-l-c))*(1+exp(l-b))))-(((1*enph)*(enph-2*kb*tem*ln(1+exp(-b+enph/(kb*tem))))/(2*kb^2*tem^2)+2*kb^2*tem^2*(-polylog(2, -exp(-b+enph/(kb*tem)))+polylog(2, -cosh(b)+sinh(b))))*enph*(kb*tem)^2-(enph^2*(enph-3*kb*tem*ln(1+exp(-b+enph/(kb*tem))))-6*kb^2*tem^2*(enph*polylog(2, -exp(-b+enph/(kb*tem)))+kb*tem*(-polylog(3, -exp(-b+enph/(kb*tem)))+polylog(3, -cosh(b)+sinh(b)))))*(kb*tem)^3/(3*kb^3*tem^3)-(-exp(b)*enph^2+exp(c+d)*enph^2-2*exp(c+d)*enph*kb*tem*ln(1+exp(-b+enph/(kb*tem)))+2*exp(b)*enph*kb*tem*ln(1+exp(-c-d+enph/(kb*tem)))+2*exp(c+d)*kb^2*tem^2*polylog(2, -exp(-b))-2*exp(b)*kb^2*tem^2*polylog(2, -exp(-c-d))-2*exp(c+d)*kb^2*tem^2*polylog(2, -exp(-b+enph/(kb*tem)))+2*exp(b)*kb^2*tem^2*polylog(2, -exp(-c-d+enph/(kb*tem))))*enph*(kb*tem)^2/((2*(-exp(b)+exp(c+d)))*kb^2*tem^2)-(exp(b)*enph^3-exp(c+d)*enph^3+3*exp(c+d)*enph^2*kb*tem*ln(1+exp(-b+enph/(kb*tem)))-3*exp(b)*enph^2*kb*tem*ln(1+exp(-c-d+enph/(kb*tem)))+6*exp(c+d)*enph*kb^2*tem^2*polylog(2, -exp(-b+enph/(kb*tem)))-6*exp(b)*enph*kb^2*tem^2*polylog(2, -exp(-c-d+enph/(kb*tem)))+6*exp(c+d)*kb^3*tem^3*polylog(3, -exp(-b))-6*exp(b)*kb^3*tem^3*polylog(3, -exp(-c-d))-6*exp(c+d)*kb^3*tem^3*polylog(3, -exp(-b+enph/(kb*tem)))+6*exp(b)*kb^3*tem^3*polylog(3, -exp(-c-d+enph/(kb*tem))))*(kb*tem)^3/((3*(-exp(b)+exp(c+d)))*kb^3*tem^3))*aa-u*(1/(1+exp(l-b))-1/((1+exp(-l-c))*(1+exp(l-b)))) = 0, -cc*polylog(2, -exp(b))+cc*polylog(2, -exp(-c))-impurity = 0])}, {op([b, c])})];

 

thank you.

Dear All

 

I have a question about applying fsolve in MAPLE.

These codes come from an applicable model from heat transfer.

I previously solve such systems, but the fsolve takes long time, for example for N=2, I have 12 equations with 12 unknowns. But the fsolve does not work!

I try by N=3 or N=4, but a similar result has been obtained.

 

If kindly is possible, please give me a help for using fsolve more efficiently that solve my problem.

I have MAPLE 13 in my PC.

 

With kind regards,

Emran Tohidi.

 

> restart;
> with(orthopoly);
print(`output redirected...`); # input placeholder
> Digits := 20;
> N := 3; f := proc (x) options operator, arrow; cos(Pi*(x-1/2)) end proc; h1 := proc (t) options operator, arrow; 0 end proc; h2 := proc (t) options operator, arrow; 0 end proc; E := proc (t) options operator, arrow; cos(.2*Pi)*exp(-t^2) end proc;
print(`output redirected...`); # input placeholder
> u := sum(sum(b[m, n]*P(m, 2*x-1)*P(n, 2*t-1), m = 0 .. N), n = 0 .. N);
print(`output redirected...`); # input placeholder
> u := unapply(u, x, t);
print(`output redirected...`); # input placeholder
> ut := diff(u(x, t), `$`(t, 1)); ut := unapply(ut, x, t);
print(`output redirected...`); # input placeholder
> uxx := diff(u(x, t), `$`(x, 2)); uxx := unapply(uxx, x, t);
print(`output redirected...`); # input placeholder
> a := sum(c[m]*P(m, 2*t-1), m = 0 .. N); a := unapply(a, t);
print(`output redirected...`); # input placeholder
> A := fsolve(P(N+1, 2*x-1) = 0);
print(`output redirected...`); # input placeholder
> S1 := {seq(seq(ut(A[i], A[j])-a(A[j])*uxx(A[i], A[j]) = 0, i = 2 .. N), j = 2 .. N+1)}; S2 := {seq(u(A[i], 0)-f(A[i]) = 0, i = 2 .. N)}; S3 := {seq(u(0, A[j])-h1(A[j]) = 0, j = 1 .. N+1)}; S4 := {seq(u(1, A[j])-h2(A[j]) = 0, j = 1 .. N+1)}; S5 := {seq(u(.3, A[j])-E(A[j]) = 0, j = 1 .. N+1)}; S := `union`(`union`(`union`(`union`(S1, S2), S3), S4), S5);
print(`output redirected...`); # input placeholder
> sol := fsolve(S);



Dear Users

I have a problem for solving a system of linear equations that arise from collocation method for getting approximate solution of a coupled PDE and ODE in Food engineering problems.

When it reach to the fsolve command it takes long time!!!

I used maple 13.

If kindly is possible, please help me in this special case.

With kind regards,

Emran Tohidi.

 

> Restart;
print(`output redirected...`); # input placeholder
> h := 50; hm := 0.1e-3; rhodp := 1500; Y := 0.5e-1; T0 := 20; rhoair := 1.2041; Dair := 0.2e-8; DD := 0.85e-9; C := 3240; L := 0.4e-1; X0 := 1.5; V := .2; delta := 0.2e-2; Yair := 0.5e-1; nu := .2; Tair := 60; Hnu := 2400; rho := 1359; tt := 3;
%;
> N := 5; Digits := 20;
> X := sum(sum(a[m, n]*z^m*t^n, m = 0 .. N), n = 0 .. N); X := unapply(X, z, t); Xt := diff(X(z, t), `$`(t, 1)); Xt := unapply(Xt, z, t); Xz := diff(X(z, t), `$`(z, 1)); Xz := unapply(Xz, z, t); Xzz := diff(X(z, t), `$`(z, 2)); Xzz := unapply(Xzz, z, t); T := sum(b[n]*t^n, n = 0 .. (N+1)^2-1); T := unapply(T, t); Tt := diff(T(t), `$`(t, 1)); Tt := unapply(Tt, t); aw := exp(.914)*X(z, t)^.5639-.5*exp(1.828)*X(z, t)^(2*.5639); aw := unapply(aw, z, t); TT := 8.3036+3816.44*(1+T(t)/(46.13)+T(t)^2/46.13^2)/(46.13); TT := unapply(TT, t); pwv := 133.3*(1+TT(t)+(1/2)*TT(t)^2); pwv := unapply(pwv, t); Yi := .622*pwv(t)*aw(z, t)*(1+pwv(t)*aw(z, t)/rho+(pwv(t)*aw(z, t)/rho)^2)/rho; Yi := unapply(Yi, z, t);
%;
> S1 := {seq(seq(Xt(delta*i/N, tt*j/N)-DD*Xzz(delta*i/N, tt*j/N) = 0, i = 1 .. N-1), j = 1 .. N)};
> S2 := {seq(DD*rhodp*Xz(delta, tt*j/N)+hm*rhoair*Yi(delta, tt*j/N) = 0, j = 0 .. N)};
> S3 := {seq(Xz(0, tt*j/N) = 0, j = 0 .. N)};
> S4 := {seq(X(delta*i/N, 0) = 0, i = 1 .. N-1)};
> S5 := {seq(seq(rho*delta*C*Tt(tt*j/N)-h*(Tair-T(tt*j/N))+hm*Hnu*rhoair*(Yair-Yi(delta*i/N, tt*j/N)) = 0, j = 1 .. N), i = 0 .. N)};
print(`output redirected...`); # input placeholder
> S6 := {seq(rho*delta*C*Tt(0)-h*(Tair-T0)+hm*Hnu*rhoair*(Yair-Yi(delta*i/N, 0)) = 0, i = 0 .. N)};
%;
> SS := `union`(`union`(`union`(`union`(`union`(S1, S2), S3), S4), S5), S6);
> sol := fsolve(SS);

Hello,

 

  I have a question. Consider

 

fsolve(x^2+3*x+1=3, x);

 

  I want to save the two roots into two variables. What kind of commend shall I use? 

 

P.S. My further aim comes from solving an equation without analytical solution. Therefore I cannot plug in the solution formula. 

 

 

Can someone help me to solve system of equations please. I have a system of 8 complex valued equations, with 8 unknowns: _C1,_C2........_C8

Equation system looks like:

eq_system:={ -3.248046797 10 _C1 + 1.773373463 10 _C2 + (2.182313824 10 - 9.987524076 10 I) _C3 + 1.773373463 10 _C4 = -7.389056097 10 _C2- 7.389056097 10 _C4+ (4.161468365 10 + 9.092974265 10 I)_C3,

............}  its only 1st equation, others are similar.

It looks rather simple though I am not able to solve it with solve or fsolve commands. What I'm doing wrong?

solve(eq_system,{_C1,_C2,_C3,_C4,_C5,_C6,_C7,_C8});

I'm trying to interpolate values using spline (data,x,degrees=2).

So I'm setting curvefit:=spline(data,x,degrees=2);

fsolve(curvefit=4,x);

However, I'm trying to solve this over a range of values in matrix M:=1..2000;

I'm sifting through the online documentation, but I can't find a proper way to do this. Ideally, i'd want to store the results as a seperate matrix.

1 2 3 4 5 6 7 Page 1 of 8