Items tagged with method method Tagged Items Feed

Hi,

Thank you very much for your idea in previous discussion: this is the link.

http://www.mapleprimes.com/questions/202744-Calculs-Using-Maple

I asked how can I plot the phase portrait of this system

Sys1 := {diff(r(t),t) = r(t)^2*sin(theta(t)), diff(theta(t),t) = -r(t)^2*(-2*cos(theta(t))^2+1)};

I get this answer:

 

1) For me it's not necessary to give an initial condition to plot the pharse portrait.

2) What is the line in this phase portrait.

3) Here, I try a second method using Matlab code, I get:

 

and this is the code:

[r, theta] = meshgrid(0:pi/4:2*pi, 0:pi/4:2*pi);
rdot =r.^2.*sin(theta) ;
thetadot = r.^2.*(1-2*sin(theta).^2);
quiver(r,theta,rdot,thetadot)
xlabel('r')
ylabel('theta')

the arrow in the phase portrait are not the same.

Can someone give me more clear information about this problem.

Many thinks.

 

I am a problem with solve differential equation, please help me: THANKS 

g := (y^2-1)^2; I4 := int(g^4, y = -1 .. 1); I5 := 2*(int(g^3*(diff(g, y, y)), y = -1 .. 1)); I6 := int(g^3*(diff(g, y, y, y, y)), y = -1 .. 1); with(Student[Calculus1]); I10 := ApproximateInt(6/(1-f(x)*g)^2, y = -1 .. 1, method = simpson);

dsys3 := {I4*f(x)^2*(diff(f(x), x, x, x, x))+I5*f(x)^2*(diff(f(x), x, x))+I6*f(x)^3 = I10, f(-1) = 0, f(1) = 0, ((D@@1)(f))(-1) = 0, ((D@@1)(f))(1) = 0};

dsol5 := dsolve(dsys3, numeric, output = array([0.]));

              Error, (in dsolve/numeric/bvp) system is singular at left endpoint, use midpoint method instead

****************FORMAT TWO ********************************************************

g := (y^2-1)^2; I4 := int(g^4, y = -1 .. 1); I5 := 2*(int(g^3*(diff(g, y, y)), y = -1 .. 1)); I6 := int(g^3*(diff(g, y, y, y, y)), y = -1 .. 1); with(Student[Calculus1]); I10 := ApproximateInt(6/(1-f(x)*g)^2, y = -1 .. 1, method = simpson);
dsys3 := {I4*f(x)^2*(diff(f(x), x, x, x, x))+I5*f(x)^2*(diff(f(x), x, x))+I6*f(x)^3 = I10, f(-1) = 0, f(1) = 0, ((D@@1)(f))(-1) = 0, ((D@@1)(f))(1) = 0};

dsol5 := dsolve(dsys3, method = bvp[midrich], output = array([0.]));
%;
                                   Error, (in dsolve) too many levels of recursion

I DONT KNOW ABOUT THIS ERROR

PLEASE HELP ME

THANKS A LOT

 

Hi every body:

how can i solve this equations(without numerical method):

eq1 := (D[1, 1](eta11))(t, a*t, a^2*t)+1.326096634*10^8*Pi^2*eta11(t, a*t, a^2*t)-3.315241586*10^7*Pi*eta21(t, a*t, a^2*t) = 0

eq2 := 2.054901810*10^13*eta21(t, a*t, a^2*t)+(D[1, 1](eta21))(t, a*t, a^2*t)-8.219607239*10^13*Pi*eta11(t, a*t, a^2*t)+4.137421500*10^8*Pi^2*eta21(t, a*t, a^2*t) = 0

eq3 := (D[1, 1](eta31))(t, a*t, a^2*t)+4.137421500*10^8*Pi^2*eta31(t, a*t, a^2*t) = 0

Dear all,

I would like to solve the Fredholm Integral equation, using numerical method.
This is my code.

there is a problem with subs, does not working here.
# Then, we obtain from (9) the coeficient A[n] and B[n].

Then I woulk like to recompute (2), and then compute (1).
# Puting x=m*h, in (1), how can we generate a linear Matrix from (1).

 

Fred.mw

Thanks

Hi.

please, I need some code about stepsize adaptative Runge Kutta method ( any order ) or other methods.

Thanks

Dear all,

Thank you for your Help.

h: stepsize;

x in [0,x0];

I give all the step of my code, but I think there is a mistake. I wait for your Help.

I would like to compute the error between  Method Huen with step size h and step size 2h using the definition of epsilon given below:

 ## The error written epsilon(x0,h)= sqrt(1/(N+1) * sum_i=0^N  (y_i^{2h}-y_(2i)^h)^2 ), where y_i^(2h) is the approximation of y(i*2*h).

 ## We want : loglog epsilon versus h.

  epsilon:=(x0,h)->sqrt( 1/(N+1)*add( (Heun1(f,x0,i)-Heun2(f,x0,i))^2,i=0..N ) );

  f:=(x,y)=1/(1+cos(y)); 

  ode:=diff(y(x),x)=f(x,y);

ic:=y(0)=1;  h:=x0/(2*N);

## Method Heun with step size 2h

> Heun1 := proc (f, x0,)

local x, y, i, h, k;

y := Array(0 .. N);

x := Array(0 .. N);

h := evalf((1/2)*x0/N);

x[0] := 0;

y[0] := 1;

for i from 0 to N do

x[i+1] := (2*i+2)*h;

k[1] := f(x[i], y[i]);

k[2] := f(x[i]+h, y[i]+h*k[1]);

y[i+1] := y[i]+h*((1/2)*k[1]+(1/2)*k[2]);

end do;

[seq([x[i], y[i]], i = 0 .. N)];

end proc;

### Now Heun with step size h  ( the same h)

> Heun2 := proc (f, x0,)

local x, y, i, h, k;

y := Array(0 .. N);

x := Array(0 .. N);

h := evalf((1/2)*x0/N);

x[0] := 0;

y[0] := 1;

for i from 0 to N do

x[i+1] := (i+1)*h;

k[1] := f(x[i], y[i]);

k[2] := f(x[i]+h, y[i]+h*k[1]);

y[i+1] := y[i]+h*((1/2)*k[1]+(1/2)*k[2]);

end do;

[seq([x[2*i], y[2*i]], i = 0 .. N)];

end proc;

 

 

Thanks you for your help.


                                

                        

 

I can get the function to iterate as a recursive function by just reevaluating the x := evalf(x-(f1*j-i*g1)/(h*k-i*j), 25); y := evalf(y-(h*g1-f1*j)/(h*k-i*j), 25) portion of the function below but im trying beneath it to assign it as newt2d so that i can iterate it as newtons method in two variables like (newt2d@@10) and I can't seem to figure out what im doing wrong. Thanks for any help you can provide!

f := proc (x, y) options operator, arrow; x+y-cos(x)+sin(y-1) end proc; f1 := f(x, y)

(x, y) -> x + y - cos(x) + sin(y - 1)
x + y - cos(x) + sin(y - 1)

> g := proc (x, y) options operator, arrow; x^4+y^4-2*x*y end proc; g1 := g(x, y);

(x, y) -> x + y - 2 x y
x + y - 2 x y

> dh := D[1](f); h := dh(x, y);

(x, y) -> 1 + sin(x)
1 + sin(x)

> di := D[2](f); i := di(x, y);

(x, y) -> 1 + cos(y - 1)
1 + cos(y - 1)

> dj := D[1](g); j := dj(x, y);

(x, y) -> 4 x - 2 y
4 x - 2 y

> dk := D[2](g); k := dk(x, y);

(x, y) -> 4 y - 2 x
4 y - 2 x

x := .3; y := .8

0.3
0.8

> x := evalf(x-(f1*j-i*g1)/(h*k-i*j), 25); y := evalf(y-(h*g1-f1*j)/(h*k-i*j), 25);

0.2924403963319692595180140
0.8321243516906678979858730

> newt2d(.3, .8);

0.2577789764, 0.8333916830

> (newt2d@@5)(.3, .8);

Error, (in @@) invalid arguments



Dear all,

here, I propose two methods for Adams Moulton Methos, but which one can I used.

The n-step Adams Moulton method to solve y'(x)=F(x,y(x)) is defined by the stencil

y(x+h)=y(x)+h *sum_{j=-1}^{n-1} beta_j F( x-j*h, y(x-j*h) ) + O(h^{n+2})

I want a procedure with single argument ''n'' that calculates and return the ''beta_i'' coefficients

I get two Methods. Which one correspond to my question please, and I don't understand the procedure proposed.

For me; the first give the iterative schemae used, but don't return the vector coefficients ( beta_i) and this methode method an interpolation of the function.

The second method, there is a function f, how this function is maded, and the same for the matrux A and the vector b...

the First Method:

> Adamsmoulton := proc (k::posint)

local P, t, f, y, n;

P := interp([t[n]+h, seq(t[n]-j*h, j = 0 .. k-2)], [f[n+1], seq(f[n-j], j = 0 .. k-2)], x);

y[n+1] = y[n]+simplify(int(P, x = t[n] .. t[n]+h))

end proc;

 

Second Method:

f:=proc(x,y) if x =0 and y=0 then 1 else x**y fi end;

n:=3; A:=matrix(n,n,(i,j)->f(1-j,1-i));

b:=vector(n, i->1/i);

linsolve(A,b);

 

Respected sir,

     Maple package is very useful to all the Mathematics students to work with. however, i came to know how to solve

system coupled non-linear ODEs with boundary condtions in Maple 12.0. But my doubt is, the tool 'Boundary value problem solver' which methods and submethods are used to solve those BVPs. Sir please, clear my doubt. your response is highly helpfull for me. Please kindly do the need full.

Thanking you.

How to open batch maple output as mws in Maple Player?  I was used to doing this daily at work before retirement in my university office on a campus computer.  There was an "open" command in a file menu of some sort that I could click on, I seem to remember.   Am just fresh afte downloading Maple Player on my iMac and have it installed.  The file from my batch Maple output is form a run of batch Maple on the office machine that I can logon to remotely from home, as I did in this case.  I get rough looking graphic output (using the alphabet style graphics methods).  It would be good to have a more detailed and fine grained graphics to answer some basic questions that I am analyzing.  Thanks . . !!

hey maple followers,

i need, please to find the method used in command "minimize".
i looked into help maple and i found "theorema mean values" as example
some help please
thanks!

P.s: minimize not Minimize

I have theoretically 3(could eventually be more) layers with an incident wave with a wave equation for that wave.

It refracts into the 2nd layer from the first and now has a 2nd wave equation, then from the 2nd into the 3rd layer with a 3rd wave equation.

All the wave equations are of the form, Psi(z) = A_1psi_1(z) + B_1psi_2(z); this is just a general solution where psi_1&2 are linearly independant solutions that make up the general equation above and A_1 and B_1 are constant coefficients that would be A_2,B_2 and A_3,B_3 for the 2nd and 3rd layers respectively.

Transfer matrix method gives A_1,B_1 in terms of A_2,B_2(as it transfers from layer 1 to 2 they equate under boundary conditions so you can solve the simultaneous equations for results). You create a matrix of these results and multiply it with the respective matrix of the 2nd layer to 3rd layer to give you the overall transfer matrix from one side of the system to the other.

I think something to do with transfer function but not sure how to use it or set up the problem. 

Thanks in advance for any pointers.

 

Hi everyone

I'm currently working on some mandate distribution using "Jefforson's Method" but I have run into some problems.

The general form of the calculations I do is as follows:

d:=fsolve(m = floor(v1/x)+floor(v2/x), x)

But in the case of m=5, v1=4969 and v2=208 it does not work. If I change v1 a bit it works as a charm but when 
4960=<v1=<4969 it does not.

Can any of you figure out why?

 

The equation surely has a solution (well, a lot of solutions). I can figure some out just by estimating and trying. Furthermore, wolfram alpha easily gives me several solutions:

http://www.wolframalpha.com/input/?i=5+%3D+floor%284969%2Fx%29%2Bfloor%28208%2Fx%29

So how come I cannot get Maple to solve it?

 

Thanks in advance!

Hellow,

 any one know how to solve the second order differential equation using finite element method (Using Linear shape functions)

I have found very little help about the Generate command of the RandomTools package.

I also have minor gripes about the syntax. And what better way to deal with these than to voice them?

This is how I was able to generate random lists and random Matrices.

A list of 10 random integers between 1 and 100:

L := RandomTools:-Generate(list(integer(range=1..100),10));

      L := [47, 8, 46, 44, 9, 77, 59, 16, 1, 70]

 

1 2 3 Page 1 of 3