REENA KOUNDAL

15 Reputation

One Badge

7 years, 339 days

MaplePrimes Activity


These are replies submitted by REENA KOUNDAL

@tomleslie 

If we have grid point 100*100 then how we can get same values of parameters (a_1, a_2, b_1, b_2). 

As we have u and v in the following form

u := proc (x, t)
              return (sin(x)+sin(x)*a_1*x*t-sin(x)*t+cos(x)*sin(x)*b_1*t^2*x+(1/2)*sin(x)*t^2-sin(x)*((1/2)*cos(x)*a_1*x*t^2+(1/2)*sin(x)*a_1*t^2-(1/2)*cos(x)*t^2)-cos(x)*((1/2)*sin(x)*b_1*x*t^2-(1/2)*sin(x)*t^2)+cos(x)*((1/2)*sin(x)*a_1*x*t^2-(1/2)*sin(x)*t^2)-sin(x)*((1/2)*cos(x)*b_1*x*t^2+(1/2)*sin(x)*b_1*t^2-(1/2)*cos(x)*t^2)+a_1*x*((1/2)*sin(x)*a_1*x*t^2-(1/2)*sin(x)*t^2)-cos(x)*sin(x)*t^2+sin(x)*a_2*t^2*x^2+((1/2)*sin(x)*a_1*x-(1/2)*sin(x))*a_1*t^2*x-sin(x)*a_1^2*x^2*t^2+(1/2)*sin(x)^2*a_1*t^2+(1/2)*sin(x)^2*b_1*t^2)/(1+a_1*x*t+a_2*x^2*t^2);
        end proc:

v := proc (x, t)
              return  (sin(x)+sin(x)*b_1*x*t-sin(x)*t+cos(x)*sin(x)*a_1*t^2*x+sin(x)*b_2*t^2*x^2+((1/2)*sin(x)*b_1*x-(1/2)*sin(x))*b_1*t^2*x-sin(x)*b_1^2*x^2*t^2+(1/2)*sin(x)*t^2-sin(x)*((1/2)*cos(x)*a_1*x*t^2+(1/2)*sin(x)*a_1*t^2-(1/2)*cos(x)*t^2)+cos(x)*((1/2)*sin(x)*b_1*x*t^2-(1/2)*sin(x)*t^2)-cos(x)*((1/2)*sin(x)*a_1*x*t^2-(1/2)*sin(x)*t^2)-sin(x)*((1/2)*cos(x)*b_1*x*t^2+(1/2)*sin(x)*b_1*t^2-(1/2)*cos(x)*t^2)-cos(x)*sin(x)*t^2+(1/2)*sin(x)^2*a_1*t^2+(1/2)*sin(x)^2*b_1*t^2+b_1*x*((1/2)*sin(x)*b_1*x*t^2-(1/2)*sin(x)*t^2))/(t^2*x^2*b_2+t*x*b_1+1);
        end proc:

@tomleslie 

In Ode case 

x1E := t -> (95/47)*exp(-2*t)-(48/47)*exp(-96*t):
  x2E := t -> (48/47)*exp(-96*t)-(1/47)*exp(-2*t):

are the exact solu of system of equation which was later on used to calculate absolute error. The absolute error is not mentioned in mapple file.

2) We used following code

for i to M do
      eqs := eval(diff(HU(U(t), V(t), p), [p$i]), p = 0) = 0,
             eval(diff(HV(U(t), V(t), p), [p$i]), p = 0) = 0;
      ics := u[i](0) = 0, v[i](0) = 0;
      dsolve({eqs, ics});
      convert(%, int);
      assign(%);
  end do:

to find the solution of U(t) and V(t)

3) Now we have to find the value of parameters. So we used numerical method.

Here I have attached a file for Pde with six boundary conditions.

pde_nonlinearfit.mw

 

@tomleslie 

I want to solve my PDE by the following  method

Nonlinear_fit.mw

The above-mentioned code is for the system of ordinary differential equations.

I want to convert for the system of following partial differential equations

PDESYS := [diff(U(x, t), t)-(diff(U(x, t), x, x))-2*U(x, t)*(diff(U(x, t), x))+diff(U(x, t)*V(x, t), x), diff(V(x, t), t)-(diff(V(x, t), x, x))-2*V(x, t)*(diff(V(x, t), x))+diff(U(x, t)*V(x, t), x)]

ICs := [U(x, 0) = sin(x), V(x, 0) = sin(x)]

 

 

@tomleslie 

By this process, we get different values of a_1, a_2, b_1, b_2 in case of u and v. But here u and v depend on each other and have to calculate unique values of a_1, a_2, b_1, b_2 not different.

@tomleslie 

Thank you for previous help.

But I want to ask you why the above code does not work for v and show some error. Because I have to solve both equations u and v simultaneously for the parameters a_1, a_2, b_1, b_2.  You can see in attached file.

exact_try_parameter_value.mw

@tomleslie 

Thank you!

@tomleslie 

I am working in window 10 with Mapple 13 software.

@tomleslie 

When I have used following command

sol := NonlinearFit(p1(x, t), p1Vals, [x, t], output = parametervalues)

then I have faced an error 

Error, (in Statistics:-NonlinearFit) sizes of independent and dependent data do not match.

Please find the attachment.

nonlinearfit.mw

 

@tomleslie 

Thank you

I have applied the same procedure as you suggested for getting the values of the parameter by NonlinearFit command. But I am facing following error:

restart;

p1 := proc (x, t) options operator, arrow; (sin(x)+sin(x)*a[1]*x*t-sin(x)*t+cos(x)*sin(x)*b[1]*t^2*x+(1/2)*sin(x)*t^2-sin(x)*((1/2)*cos(x)*a[1]*x*t^2+(1/2)*sin(x)*a[1]*t^2-(1/2)*cos(x)*t^2)-cos(x)*((1/2)*sin(x)*b[1]*x*t^2-(1/2)*sin(x)*t^2)+cos(x)*((1/2)*sin(x)*a[1]*x*t^2-(1/2)*sin(x)*t^2)-sin(x)*((1/2)*cos(x)*b[1]*x*t^2+(1/2)*sin(x)*b[1]*t^2-(1/2)*cos(x)*t^2)+a[1]*x*((1/2)*sin(x)*a[1]*x*t^2-(1/2)*sin(x)*t^2)-cos(x)*sin(x)*t^2+sin(x)*a[2]*t^2*x^2+((1/2)*sin(x)*a[1]*x-(1/2)*sin(x))*a[1]*t^2*x-sin(x)*a[1]^2*x^2*t^2+(1/2)*sin(x)^2*a[1]*t^2+(1/2)*sin(x)^2*b[1]*t^2)/(1+a[1]*x*t+a[2]*x^2*t^2) 

p2 := proc (x, t) options operator, arrow; (sin(x)+sin(x)*b[1]*x*t-sin(x)*t+cos(x)*sin(x)*a[1]*t^2*x+sin(x)*b[2]*t^2*x^2+((1/2)*sin(x)*b[1]*x-(1/2)*sin(x))*b[1]*t^2*x-sin(x)*b[1]^2*x^2*t^2+(1/2)*sin(x)*t^2-sin(x)*((1/2)*cos(x)*a[1]*x*t^2+(1/2)*sin(x)*a[1]*t^2-(1/2)*cos(x)*t^2)+cos(x)*((1/2)*sin(x)*b[1]*x*t^2-(1/2)*sin(x)*t^2)-cos(x)*((1/2)*sin(x)*a[1]*x*t^2-(1/2)*sin(x)*t^2)-sin(x)*((1/2)*cos(x)*b[1]*x*t^2+(1/2)*sin(x)*b[1]*t^2-(1/2)*cos(x)*t^2)-cos(x)*sin(x)*t^2+(1/2)*sin(x)^2*a[1]*t^2+(1/2)*sin(x)^2*b[1]*t^2+b[1]*x*((1/2)*sin(x)*b[1]*x*t^2-(1/2)*sin(x)*t^2))/(1+b[1]*x*t+b[2]*x^2*t^2) 

a_1 := 1: a_2 := 5: b_1:= 6; b_2 := 3

tVals := Vector([seq(t, t = 0 .. 10)])

xVals := Vector([seq(x, x = 0 .. 20)])

p1Vals := Vector([seq(evalf(p1(x, t)), t = 0 .. 10)]):

p2Vals := Vector([seq(evalf(p1(x, t)), t = 0 .. 10)]):

with(Statistics);

NonlinearFit(p1(x, t), tVals, xVals, p1Vals, t, x, output = parametervalues)

Error, (in Statistics:-NonlinearFit) invalid input: no implementation of NonlinearFit matches the arguments in call, NonlinearFit((sin(x)+sin(x)*x*t-sin(x)*t+6*cos(x)*sin(x)*t^2*x+(1/2)*sin(x)*t^2-sin(x)*((1/2)*cos(x)*x*t^2+(1/2)*sin(x)*t^2-(1/2)*cos(x)*t^2)-cos(x)*(3*sin(x)*x*t^2-(1/2)*sin(x)*t^2)+cos(x)*((1/2)*sin(x)*x*t^2-(1/2)*sin(x)*t^2)-sin(x)*(3*cos(x)*x*t^2+3*sin(x)*t^2-(1/2)*cos(x)*t^2)+x*((1/2)*sin(x)*x*t^2-(1/2)*sin(x)*t^2)-cos(x)*sin(x)*t^2+4*sin(x)*t^2*x^2+((1/2)*sin(x)*x-(1/2)*sin(x))*t^2*x+(7/2)*sin(x)^2*t^2)/(1+x*t+5*x^2*t^2), op(w), Vector(11, {(1) = sin(x), (2) = (.5000000000*sin(x)+sin(x)*x+6.*cos(x)*sin(x)*x-1.*sin(x)*(.5...
 

 

Page 1 of 1