nidojan

125 Reputation

6 Badges

9 years, 20 days

MaplePrimes Activity


These are questions asked by nidojan

Dear all,
Greetings!
I have made a code that solves a nonlinear system of equations by using Newton's Method. I am facing a problem in printing the Jacobian at each iteration. It only prints its lable not the Jacobian matrix itself. Please help me in this regard.
 

"restart;  iter:=5;  f[1](x,y):=3 x^(2)-y^(2);  f[2](x,y):=3 x^()*y^(2)-x^(3)-1;"

5

 

proc (x, y) options operator, arrow; 3*x^2-y^2 end proc

 

proc (x, y) options operator, arrow; 3*x*y^2-x^3-1 end proc

(1)

var := x, y

x, y

(2)

pointt := [x[n], y[n]]

[x[n], y[n]]

(3)

NULL

NULL

NULL

x[0] := 1; y[0] := 1

1

 

1

(4)

for n from 0 to iter do print('f1' = f[1](x[n], y[n]), 'f[2]' = f[2](x[n], y[n])); print('J'*[n] = J[n]); J[n] := Student[MultivariateCalculus][Jacobian]([f[1](x, y), f[2](x, y)], [var] = pointt, output = matrix); sol[n] := eval((Vector(2, {(1) = x[n], (2) = y[n]}))-1/J[n].(Vector(2, {(1) = f[1](x[n], y[n]), (2) = f[2](x[n], y[n])}))); x[n+1] := evalf(sol[n][1]); y[n+1] := evalf(sol[n][2]); print(x[n+1], y[n+1]) end do

f1 = 2, f[2] = 1

 

J*[0] = J[0]

 

.6111111111, .8333333333

 

f1 = .4259259256, f[2] = 0.44924554e-1

 

J*[1] = J[1]

 

HFloat(0.5036590808700434), HFloat(0.8524944221287727)

 

f1 = HFloat(0.03427066946790058), f[2] = HFloat(-0.029666658033242088)

 

J*[2] = J[2]

 

HFloat(0.4999641210723523), HFloat(0.8660456363859079)

 

f1 = HFloat(-1.4267722412308892e-4), f[2] = HFloat(-1.2576398193964167e-6)

 

J*[3] = J[3]

 

HFloat(0.50000000001492), HFloat(0.8660254018170033)

 

f1 = HFloat(3.45245787514159e-9), f[2] = HFloat(-5.089167087746205e-9)

 

J*[4] = J[4]

 

HFloat(0.5), HFloat(0.8660254037844386)

 

f1 = HFloat(1.1102230246251565e-16), f[2] = HFloat(-2.220446049250313e-16)

 

J*[5] = J[5]

 

HFloat(0.5), HFloat(0.8660254037844387)

(5)

NULL

NULL


 

Download q1nwtnnonlinearsys.mw

the print output is too ugly, any help in making it more elegant would also be appreciated .

Hello all
I want to integrate an equation involving different terms (some of them involve derivatives) the following picture shows the expression and the end result. I can do it manually by multiplying both sides with u'. but how can acheive that in maple
Picture

 

Eq4 := diff(u(xi), xi, xi) = a[0]+a[1]*u(xi)+a[2]*u(xi)^2; Eq5 := int(Eq4, xi); simplify(%)

diff(diff(u(xi), xi), xi) = a[0]+a[1]*u(xi)+a[2]*u(xi)^2

 

Error, (in int) wrong number (or type) of arguments: wrong type of integrand passed to indefinite integration.

 

diff(diff(u(xi), xi), xi) = a[0]+a[1]*u(xi)+a[2]*u(xi)^2

(1)

``

 

Download try.mw

Hello everybody!

Please help me to solve the attached partial differential equation. I am getting an error. I do have its analytical solution and that works fine.

The error is as follows
Error, (in pdsolve/numeric/plot) unable to compute solution for t>HFloat(0.0):
solution becomes undefined, problem may be ill posed or method may be ill suited to solution

The worksheet is attached hereshortsngle.mw

Hello everybody!
I have a PDE with initial and boundary conditions. I want to plot its solution by taking "t" as x axis. I have seen the documentation. It only has the space variable on x axis. Please show me a way to achieve what I intend.

here is the file pdsolve.mw

The value of x can be chosen as 0.16 or 0.21

I am trying to solve a PDE using pdsolve-numeric. I am getting an error related to boundary conditions.
Please see the follwing worksheet and suggest me some solutions

pdsolve.mw

1 2 3 4 Page 3 of 4