Items tagged with fsolve

Feed

hi

please help me for fsolve algebric equations...

thanks

AGM.mw
 

restart:

F(eta):=sum(a[i]*eta^i,i=0..5):

theta(eta):=sum(b[i]*eta^i,i=0..5):K(eta):=sum(c[i]*eta^i,i=0..5):Omega(eta):=sum(d[i]*eta^i,i=0..5):

``

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:

F(eta):=unapply(F(eta),eta):

theta(eta):=unapply(theta(eta),eta):K(eta):=unapply(K(eta),eta):Omega(eta):=unapply(Omega(eta),eta):

U1:=unapply(U1,eta):U2:=unapply(U2,eta):U3:=unapply(U3,eta):U4:=unapply(U4,eta):

 

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

(1)

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):

 

 

Q:=fsolve([s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s24],{a[0],a[1],a[2],a[3],a[4],a[5],b[0],b[1],b[2],b[3],b[4],b[5],c[0],c[1],c[2],c[3],c[4],c[5],d[0],d[1],d[2],d[3],d[4],d[5]}):

F(eta):=eval(sum(a[i]*eta^i,i=0..5),Q):

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

 

theta(eta):=eval(sum(b[i]*eta^i,i=0..5),Q):K(eta):=eval(sum(c[i]*eta^i,i=0..5),Q):Omega(eta):=eval(sum(d[i]*eta^i,i=0..5),Q):

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

 

plot(g(x),x=0..1,axes=boxed,color=green,thickness=2,labels=[x,g]):

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

 

plot(f(x),x=0..1,axes=boxed,color=blue,thickness=2,labels=[x,f]):

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

 

 


 

Download AGM.mw

 


 

T := proc (t) options operator, arrow; 80+(-1)*1.4375*53*(1-exp((-1)*0.13775e-1*2.875*k*h__1*h__2*t/(1.4375^2*4190*(k*(h__1+h__2)+0.1e-2*h__1*h__2))))/2.875 end proc

proc (t) options operator, arrow; 80+(-1)*1.4375*53*(1-exp((-1)*0.13775e-1*2.875*k*h__1*h__2*t/((1.4375^2*4190*(k*(h__1+h__2)+0.1e-2*h__1*h__2)))))/2.875 end proc

(1)

T(204.39)

53.50000000+26.50000000*exp(-8.094482719*k*h__1*h__2/(8658.242188*k*(h__1+h__2)+8.658242188*h__1*h__2))

(2)

T(429.63)

53.50000000+26.50000000*exp(-17.01469059*k*h__1*h__2/(8658.242188*k*(h__1+h__2)+8.658242188*h__1*h__2))

(3)

T(872.5)

53.50000000+26.50000000*exp(-34.55372656*k*h__1*h__2/(8658.242188*k*(h__1+h__2)+8.658242188*h__1*h__2))

(4)

fsolve({53.50000000+26.50000000*exp(-34.55372656*k*h__1*h__2/(8658.242188*k*(h__1+h__2)+8.658242188*h__1*h__2)) = 56.15, 53.50000000+26.50000000*exp(-17.01469059*k*h__1*h__2/(8658.242188*k*(h__1+h__2)+8.658242188*h__1*h__2)) = 64.1, 53.50000000+26.50000000*exp(-8.094482719*k*h__1*h__2/(8658.242188*k*(h__1+h__2)+8.658242188*h__1*h__2)) = 72.05}, {h__1 = 0 .. 1000, h__2 = 0 .. 1000, k = 0 .. 1000})

fsolve({53.50000000+26.50000000*exp(-34.55372656*k*h__1*h__2/(8658.242188*k*(h__1+h__2)+8.658242188*h__1*h__2)) = 56.15, 53.50000000+26.50000000*exp(-17.01469059*k*h__1*h__2/(8658.242188*k*(h__1+h__2)+8.658242188*h__1*h__2)) = 64.1, 53.50000000+26.50000000*exp(-8.094482719*k*h__1*h__2/(8658.242188*k*(h__1+h__2)+8.658242188*h__1*h__2)) = 72.05}, {h__1, h__2, k}, {h__1 = 0 .. 1000, h__2 = 0 .. 1000, k = 0 .. 1000})

(5)

``

it would be great if you could explain me why maple cant numerically solve this set of 3 ecuatios for h1, h2, k being my unknows terms, it works with an exponential function. there is a way to solve it?

thanks..
 

Download heat_ecuation.mw

So I am trying to find the structure of a material from x-ray diffraction data. To accomplish this I have to solve a system of nonlinear equations. Since there is some unaccuracy in the measurements I wanted to use a numerical tool, so I am trying to solve using fsolve. To check that I am doing this correctly I am trying to solve a set of similar equations where I know the solution. My code is shown below.

eqs := {(2^2/a^2+2^2/c^2-2*(2*2)*cos(x)/(a*c))/sin(x)^2 = 1/2.2393^2, (2^2/a^2+4^2/c^2+4*(2*2)*cos(x)/(a*c))/sin(x)^2 = 1/1.5968^2, (1^2/a^2+sin(x)^2/b^2+2^2/c^2+(2*2)*cos(x)/(a*c))/sin(x)^2 = 1/2.7896^2, 1/sin(x)^2*(2^2*sin(x)^2/b^2) = 1/2.8650^2}

fsolve(eqs)

For this system I know that a = 5.44 b = 5.73 c = 7.89 x=pi/2, but fsolve only returns the input.

Am I doing something wrong or should I use a different function? I am quite new to Maple, so have some patience with me.

Thanks in advance.

Very new to using Maple or coding in general. Ran into a problem that I couldn't figure it out.

Any help would be greatly appreciated.

I have a problem integrating a solution from fsolve.   I read in another post on this forum that the solution was to use unapply.   This works if I then set up the integration as suggested (i.e., without giving the argument to the function), but not if you do it in a way that seems logical to me (i.e.,the first version of the int command marked ‘fails’ below.   if you can plot a function why can’t you integrate it ?).  

Anyway the real problem I have is if I want to use the solution found using fsolve as the argument of another function (h below) and then integrate that.  I assume the final line fails because of the same reason the initial attempt to integrate g(x) fails. However, I can’t figure out what the equivalent notation would be if I wanted to omit the ‘x’ variable.   I tried using unapply again, and also putting in quotes, but nothing works.

> restart;

> g:=unapply('fsolve(a*y^2-sin(y),y=2)',a);

> plot('g(x)',x=1..2);

> evalf(Int('g(x)',x=1..2));#this fails

> evalf(Int(g,1..2));#this works fine

> h:=x->x*sin(x);

> h(g(1.0));

> h(g(2.0));

> evalf(Int(h(g(x)),x=1..2));# this fails

I mean the root of the equation

GAMMA(n-1/n)*GAMMA(1/n)/(n*GAMMA(n)) = 1

belonging to RealRange(Open(1),4). It should be noticed there are solutions outside this interval. Here is my try.

 

``

solve({n > 1, GAMMA(n-1/n)*GAMMA(1/n)/(n*GAMMA(n)) = 1, n < 4}, [n])``

[]

(1)

`in`(which*is*wrong, view*of)

simplify(eval(GAMMA(n-1/n)*GAMMA(1/n)/(n*GAMMA(n)), n = (1/2)*sqrt(5)+1/2))

1

(2)

Also

Student[Calculus1]:-Roots(A = 1, n = 1 .. 4)

[1.618033989]

(3)

There is a substitute

fsolve(GAMMA(n-1/n)*GAMMA(1/n)/(n*GAMMA(n)) = 1, n = 1 .. 4)

1.618033989

(4)

NULL

identify(%)

(1/2)*5^(1/2)+1/2

(5)

``

There is a shade of hope that GAMMA(n-1/n)*GAMMA(1/n)/(n*GAMMA(n))  can be simplified.

Download solution.mw

 PS. An SCR was submitted by me.

Hello all,

I try to solve this system using maple 18 by "fsolve", but I don't get the solution, I don't Know what is the problem or What this mean.

Do you have any idea?

 

Best Regards L.Sn=10_R=23.5.mw

Hey there,

I am using the fsolve command in order to solve numerically a system of equations with N equations and N unknowns. According to my discretization the number of equations changes. If I have a small number of equations it all works out perfectly. But if I increase the number of equations I just get something like that:

Sorry, for the long post, but for a small number of unknowns Ai it works. It seems that maple doesnt try to compute? Has anyone encountered the same problems?

 

Any help is appreciated.

Jens

In functions such as fsolve, there is an optional parameter that allows one to specify the interval to perform the function on. Additionally, sometimes, if a solution is left out, one can specify an interval to search on to obtain the missing solution.

How does Maple determine the interval to search on if this is not specified?

 

(Additional Question - you don't have to answer this)

Ultimately, I am asking this question because I have a function for Newton's method; however, it requires an interval to run. I have read that fsolve uses Newton's method, so I am curious how to automatically select such an interval. Does anyone know how to implement such a thing?

I am curious about the numerical method(s) used by Maple to calculate fsolve. I've looked at the documentation (https://www.maplesoft.com/support/help/maple/view.aspx?path=fsolve%2fdetails), but the method(s) used are not stated on there. Does anyone know which method Maple uses in fsolve? Additionally, does Maple use multiple methods and if so, how does it determine which one to use? Thanks!

Hi Maple community

I'm running an algorithm where a non-linear equation system must be solved, in this case is a 26x26 system.

After 16116 succesful previous computations, fsolve stops giving me results.
I checked why and I was first expecting that, for some reason, the 26x26 system had an error and I ended with something like 25x26 or vice versa. But that was not the case.

So I tried the command solve and it not only worked fine but also gave me two results, but I only need one. I guess I could check for the wrong solution and discard it, but I still wondering why fsolve is failing and if there is anything to help fsolve not to fail.

These are the set of equations if somebody wants to check them:

EQ[16117][1] := W[1, 16117]*(-0.3860115660e-1*HRa[1, 16117]-0.1876793978e-1*ga[1, 16117]+0.7836678184e-1) = 2.040147478*10^6*SR[1, 16118], W[1, 16117]*(-0.3915554290e-1*HRa[1, 16117]-0.1903748329e-1*ga[1, 16117]+0.8260795999e-1) = 3.876387504, W[1, 16117]*(-0.1876794098e-1*HRa[1, 16117]-0.9892449327e-2*ga[1, 16117]+0.3810204607e-1) = 2.040147478*10^6*v[1, 16118], HLa[1, 16117] = .9724029753*ga[1, 16117]+HRa[1, 16117], NRa[1, 16117] = 0.7006679273e-1*HRa[1, 16117]-.1803623678*ga[1, 16117]+1.002451672, NLa[1, 16117] = 0.7006679273e-1*HRa[1, 16117]+.2484955248*ga[1, 16117]+1.002451672, SL[2, 16118] = SR[1, 16118], fra[1, 16117] = HRa[1, 16117]-HLa[2, 16117], fra[1, 16117] = .25*NRa[1, 16117]+.25*NLa[2, 16117], ga[1, 16117] = 0.;

EQ[16117][2] := W[2, 16117]*(-0.3860115660e-1*HRa[2, 16117]-0.1876793978e-1*ga[2, 16117]+0.7836678184e-1) = -2.040147478*10^6*SL[2, 16118]+7.152482840, W[2, 16117]*(-0.3915554290e-1*HRa[2, 16117]-0.1903748329e-1*ga[2, 16117]+0.8260795999e-1) = 3.876387504, W[2, 16117]*(-0.1876794098e-1*HRa[2, 16117]-0.9892449327e-2*ga[2, 16117]+0.3810204607e-1) = -1.983845478*10^6*SL[2, 16118]+5.221405977, HLa[2, 16117] = .9724029753*ga[2, 16117]+HRa[2, 16117], NRa[2, 16117] = 0.7006679273e-1*HRa[2, 16117]-.1803623678*ga[2, 16117]+1.002451672, NLa[2, 16117] = 0.7006679273e-1*HRa[2, 16117]+.2484955248*ga[2, 16117]+1.002451672, SL[3, 16118] = 0.3505865589e-5, fra[2, 16117] = HRa[2, 16117]-HLa[3, 16117];

EQ[16117][3] := W[3, 16117]*(-0.3860115660e-1*HRa[3, 16117]-0.1876793978e-1*ga[3, 16117]+0.7836678184e-1) = -2.040147478*10^6*SL[3, 16118]+10.82168541, W[3, 16117]*(-0.3915554290e-1*HRa[3, 16117]-0.1903748329e-1*ga[3, 16117]+0.8260795999e-1) = 3.876387504, W[3, 16117]*(-0.1876794098e-1*HRa[3, 16117]-0.9892449327e-2*ga[3, 16117]+0.3810204607e-1) = -1.983845478*10^6*SL[3, 16118]+8.751240594, HLa[3, 16117] = .9724029753*ga[3, 16117]+HRa[3, 16117], NRa[3, 16117] = 0.7006679273e-1*HRa[3, 16117]-.1803623678*ga[3, 16117]+1.002451672, NLa[3, 16117] = 0.7006679273e-1*HRa[3, 16117]+.2484955248*ga[3, 16117]+1.002451672, SL[4, 16118] = 0.5304364281e-5, fra[3, 16117] = HRa[3, 16117];

And after these the solving command that I used was:

SOL[j]:=fsolve({seq(EQ[j][n],n=1..N)},indets({entries(EQ[j],nolist)},assignable(name)));

Which returns

SOL[j]:=

As I said, then I tried the solve command:

SOL[j]:=solve({seq(EQ[j][n],n=1..N)},indets({entries(EQ[j],nolist)},assignable(name)));

which returns:

SOL[16117] :=

{HLa[1, 16117] = 1.011251860, HLa[2, 16117] = .5007913055, HLa[3, 16117] = -0.4240068535e-1, HRa[1, 16117] = 1.011251860, HRa[2, 16117] = .8728245835, HRa[3, 16117] = .2686716410, NLa[1, 16117] = 1.073306847, NLa[2, 16117] = .9685353734, NLa[3, 16117] = .9417827567, NRa[1, 16117] = 1.073306847, NRa[2, 16117] = 1.132612831, NRa[3, 16117] = 1.078974668, SL[2, 16118] = 0.1737463747e-5, SL[3, 16118] = 0.3505865589e-5, SL[4, 16118] = 0.5304364281e-5, SR[1, 16118] = 0.1737463747e-5, W[1, 16117] = 90.12372195, W[2, 16117] = 69.57451714, W[3, 16117] = 49.58407210, fra[1, 16117] = .5104605550, fra[2, 16117] = .9152252689, fra[3, 16117] = .2686716410, ga[1, 16117] = 0., ga[2, 16117] = -.3825916698, ga[3, 16117] = -.3199006320, v[1, 16118] = 8.447574110*10^(-7)},

{HLa[1, 16117] = 3.043461992, HLa[2, 16117] = 2.386862361, HLa[3, 16117] = -0.4240068535e-1, HRa[1, 16117] = 3.043461992, HRa[2, 16117] = 1.087485894, HRa[3, 16117] = .2686716410, NLa[1, 16117] = 1.215697293, NLa[2, 16117] = 1.410701230, NLa[3, 16117] = .9417827567, NRa[1, 16117] = 1.215697293, NRa[2, 16117] = .8376385519, NRa[3, 16117] = 1.078974668, SL[2, 16118] = 0.2032780481e-5, SL[3, 16118] = 0.3505865589e-5, SL[4, 16118] = 0.5304364281e-5, SR[1, 16118] = 0.2032780481e-5, W[1, 16117] = -106.0268094, W[2, 16117] = 265.7250566, W[3, 16117] = 49.58407210, fra[1, 16117] = .6565996307, fra[2, 16117] = 1.129886580, fra[3, 16117] = .2686716410, ga[1, 16117] = 0., ga[2, 16117] = 1.336253076, ga[3, 16117] = -.3199006320, v[1, 16118] = 9.883410782*10^(-7)}

Thanks in advance for any recommendations and suggestions.
 


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.

reatart:NULL``

m1 := 0.3e-1;

0.3e-1

(1)

m2 := .4;

.4

(2)

m3 := 2.5;

2.5

(3)

m4 := .3;

.3

(4)

be := .1;

.1

(5)

rho := .1;

.1

(6)

ga := 25;

25

(7)

a := 3.142;

3.142

(8)

q := .5;

.5

(9)

z[0] := 3;

3

(10)

x[0] := 1.5152;

1.5152

(11)

w[0] := 1.1152;

1.1152

(12)

a1 := be*z[0];

.3

(13)

a2 := be*x[0];

.15152

(14)

a3 := rho*w[0];

.11152

(15)

a4 := rho*z[0];

.3

(16)

a5 := rho*w[0];

.11152

(17)

a6 := rho*z[0];

.3

(18)

b1 := a1*a4*ga+a4*ga*m1;

2.475

(19)

D1 := a1+m1+m2+m3+m4;

3.53

(20)

D2 := a1*m2+a1*m3+a1*m4-a2*ga+a3*ga+m1*m2+m1*m3+m1*m4+m2*m3+m2*m4+m3*m4;

1.92600

(21)

D3 := a1*a3*ga+a1*m2*m3+a1*m2*m4+a1*m3*m4-a2*ga*m1-a2*ga*m4+a3*ga*m1+a3*ga*m4+m1*m2*m3+m1*m3*m4+m2*m3*m4+m1*m2*m3;

1.4499000

(22)

D4 := a1*a3*a4*ga+a1*m2*m3*m4-a2*ga*m1*m4+a3*ga*m1*m4+m1*m2*m3*m4;

.3409200

(23)

G1 := -a1*a6-a6*m1-a6*m2-a6*m3;

-.969

(24)

G2 := -a1*a6*m2-a1*a6*m3+a2*a6*ga-a3*a6*ga+a4*a5*ga-a6*m1*m2-a6*m1*m3-a6*m2*m3;

.549300

(25)

G3 := -a1*a3*a6*ga-a1*a6*m2*m3+a2*a6*ga*m1-a3*a6*ga*m1-a6*m1*m2*m3;

-.3409200

(26)

A1 := w^(4*q)*cos(4*q*a*(1/2))+D1*w^(3*q)*cos(3*q*a*(1/2))+D2*w^(2*q)*cos(2*q*a*(1/2))+D3*w^q*cos((1/2)*q*a)+D4;

-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200

(27)

B1 := w^(4*q)*sin(4*q*a*(1/2))+D1*w^(3*q)*sin(3*q*a*(1/2))+D2*w^(2*q)*sin(2*q*a*(1/2))+D3*w^q*sin((1/2)*q*a);

-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5

(28)

A2 := -w^(3*q)*a6*cos(3*q*a*(1/2))+G1*w^(2*q)*cos(2*q*a*(1/2))+G2*w^q*cos((1/2)*q*a)+G3;

.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200

(29)

B2 := -w^(3*q)*a6*sin(3*q*a*(1/2))+G1*w^(2*q)*sin(2*q*a*(1/2))+G2*w^q*sin((1/2)*q*a);

-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5

(30)

C := .27601200;

.27601200

(31)

Q1 := 4*C^2*(A2^2+B2^2);

.3047304966*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+.3047304966*(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2

(32)

Q2 := -4*C*A2*(A1^2-A2^2+B1^2-B2^2-C^2);

-1.10404800*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)*((-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2-(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2-(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1)

(33)

Q3 := (A1^2-A2^2+B1^2-B2^2-C^2)^2-4*C^2*B2^2;

((-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2-(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2-(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1)^2-.3047304966*(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2

(34)

V := simplify(-4*Q1*Q3+Q2^2);

-0.1e-12-0.5481797400e-1*w^11-40.93358002*w^(19/2)-212.0102604*w^(17/2)-1.048226159*w^(21/2)-8.667039897*w^10-119.4464160*w^9-208.1803245*w^8-54.3436016*w^7-38.4722894*w^6+2.67061391*w^5-2.29413863*w^4-.136247212*w^2+.899997750*w^3+0.1e-10*w^(1/2)-0.150073928e-1*w^(3/2)+0.54469063e-2*w-2.53869438*w^(11/2)-2.40374793*w^(9/2)-84.14780373*w^(15/2)-86.62603442*w^(13/2)+2.023073705*w^(7/2)-0.6906749e-2*w^(5/2)

(35)

x := (-Q2+sqrt(V))/(2*Q1);

(1/2)*(1.10404800*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)*((-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2-(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2-(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1)+(-0.1e-12-0.5481797400e-1*w^11-40.93358002*w^(19/2)-212.0102604*w^(17/2)-1.048226159*w^(21/2)-8.667039897*w^10-119.4464160*w^9-208.1803245*w^8-54.3436016*w^7-38.4722894*w^6+2.67061391*w^5-2.29413863*w^4-.136247212*w^2+.899997750*w^3+0.1e-10*w^(1/2)-0.150073928e-1*w^(3/2)+0.54469063e-2*w-2.53869438*w^(11/2)-2.40374793*w^(9/2)-84.14780373*w^(15/2)-86.62603442*w^(13/2)+2.023073705*w^(7/2)-0.6906749e-2*w^(5/2))^(1/2))/(.3047304966*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+.3047304966*(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2)

(36)

E := -2*A1*C*x-A1^2+A2^2-B1^2+B2^2-C^2;

-.2760120000*(-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)*(1.10404800*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)*((-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2-(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2-(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1)+(-0.1e-12-0.5481797400e-1*w^11-40.93358002*w^(19/2)-212.0102604*w^(17/2)-1.048226159*w^(21/2)-8.667039897*w^10-119.4464160*w^9-208.1803245*w^8-54.3436016*w^7-38.4722894*w^6+2.67061391*w^5-2.29413863*w^4-.136247212*w^2+.899997750*w^3+0.1e-10*w^(1/2)-0.150073928e-1*w^(3/2)+0.54469063e-2*w-2.53869438*w^(11/2)-2.40374793*w^(9/2)-84.14780373*w^(15/2)-86.62603442*w^(13/2)+2.023073705*w^(7/2)-0.6906749e-2*w^(5/2))^(1/2))/(.3047304966*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+.3047304966*(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2)-(-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2+(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2-(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2+(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1

(37)

y := -E/(2*C*B1);

-1.811515442*(-.2760120000*(-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)*(1.10404800*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)*((-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2-(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2-(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1)+(-0.1e-12-0.5481797400e-1*w^11-40.93358002*w^(19/2)-212.0102604*w^(17/2)-1.048226159*w^(21/2)-8.667039897*w^10-119.4464160*w^9-208.1803245*w^8-54.3436016*w^7-38.4722894*w^6+2.67061391*w^5-2.29413863*w^4-.136247212*w^2+.899997750*w^3+0.1e-10*w^(1/2)-0.150073928e-1*w^(3/2)+0.54469063e-2*w-2.53869438*w^(11/2)-2.40374793*w^(9/2)-84.14780373*w^(15/2)-86.62603442*w^(13/2)+2.023073705*w^(7/2)-0.6906749e-2*w^(5/2))^(1/2))/(.3047304966*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+.3047304966*(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2)-(-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2+(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2-(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2+(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1)/(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)

(38)

``

fsolve(x^2+y^2 = 1, w)

fsolve((1/4)*(1.10404800*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)*((-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2-(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2-(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1)+(-0.1e-12-0.5481797400e-1*w^11-40.93358002*w^(19/2)-212.0102604*w^(17/2)-1.048226159*w^(21/2)-8.667039897*w^10-119.4464160*w^9-208.1803245*w^8-54.3436016*w^7-38.4722894*w^6+2.67061391*w^5-2.29413863*w^4-.136247212*w^2+.899997750*w^3+0.1e-10*w^(1/2)-0.150073928e-1*w^(3/2)+0.54469063e-2*w-2.53869438*w^(11/2)-2.40374793*w^(9/2)-84.14780373*w^(15/2)-86.62603442*w^(13/2)+2.023073705*w^(7/2)-0.6906749e-2*w^(5/2))^(1/2))^2/(.3047304966*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+.3047304966*(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2)^2+3.281588197*(-.2760120000*(-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)*(1.10404800*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)*((-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2-(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2-(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1)+(-0.1e-12-0.5481797400e-1*w^11-40.93358002*w^(19/2)-212.0102604*w^(17/2)-1.048226159*w^(21/2)-8.667039897*w^10-119.4464160*w^9-208.1803245*w^8-54.3436016*w^7-38.4722894*w^6+2.67061391*w^5-2.29413863*w^4-.136247212*w^2+.899997750*w^3+0.1e-10*w^(1/2)-0.150073928e-1*w^(3/2)+0.54469063e-2*w-2.53869438*w^(11/2)-2.40374793*w^(9/2)-84.14780373*w^(15/2)-86.62603442*w^(13/2)+2.023073705*w^(7/2)-0.6906749e-2*w^(5/2))^(1/2))/(.3047304966*(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2+.3047304966*(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2)-(-.9999999170*w^2.0-2.496849400*w^1.5-0.3922745903e-3*w^1.0+1.025129710*w^.5+.3409200)^2+(.2121968329*w^1.5+0.1973593344e-3*w^1.0+.3883741982*w^.5-.3409200)^2-(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2+(-.2120672160*w^1.5-.9689999799*w^1.0+.3884533076*w^.5)^2-0.7618262414e-1)^2/(-0.4073463989e-3*w^2.0+2.495324242*w^1.5+1.925999960*w^1.0+1.025338523*w^.5)^2 = 1, w)

(39)

``

 

Download root.mw

Hi, I have the equations (below) with different parameters. I'd like to find out if is it possitble to:

(1) Create a loop that solves for values of on of the parameters, T, in the interval -0.3<T<0.3 and obtain the solutions allowing for a grid of 0.01.

That is, if one can first solve for T= -0.3 and then use the loop with increments that raise T by 0.01 each time until T=0.3. Other parameters are held constant at their assigned values.

(2) Generates the corresponding vectors for T and all the endogenous variables.

eq1 := PI_T = alpha*M*(kappa/(1+kappa-sigma)-1):
eq2 := l = alpha*((sigma-1)*kappa/(1+kappa-sigma)+1):
eq3 := M = phi_c^(-kappa)*F:
eq4 := e*F = PI_T*v+T:
eq5 := M*l+L_A = L_s:
eq6 := F*e+A = A_s:
eq7 := A = (1-beta)*(L_s+(1-v)*PI_T-T):
eq8 := A_s = L_A:
eq9 := p = sigma/((sigma-1)*phi):
eq10 := P_Y = M^(lambda/(1-sigma))*p:
eq11 := L_s = N*(theta*P_Y^beta)^(-1/delta):
eq12 := phi = (kappa/(1+kappa-sigma))^(1/(sigma-1))*phi_c:
eq13 := U = delta*theta*L_s/((1+delta)*P_Y^beta)+((1-v)*PI_T-T)/P_Y^beta:

Params:= [ T=0, N = 1, v = 1, beta = .75, lambda = 1, sigma = 5, kappa = 4.8, delta = 2, theta = 2.591350635, alpha = 0.3998699153e-1, e = 0.8333333332e-1]:

Init_Values:= {A_s = .2500000000, l = .9996747882, PI_T = 0.8333333332e-1, L_A = .2500000000, phi = 1.878101496, M = .4168022157, A = .1666666667, p = .6655657336, P_Y = .8283396488, L_s = 2/3, phi_c = 1.2, F = 1, U = 1.326439132 }:


SOL:= fsolve(eval({eq||(1..13)}, Params), Init_Values);

 

Many thanks!!

I am trying to find the root of an equation. The problem is, I keep getting the error

"Error, (in fsolve) Can't handle expressions with typed procedures"

and 

Warning, solutions may have been lost


whenever I try to solve it. Anyone have any ideas? My worksheet is here:  1.mw

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