vv

13922 Reputation

20 Badges

10 years, 10 days

MaplePrimes Activity


These are replies submitted by vv

@mmcdara 

OK, but I met Olympiad students who know Newton's formulae. It's a good opportunity for the OP to know about them.

@mmcdara 

The standard and straightforward way to solve such problems is via Newton's identities.

s[0]:=3: s[1]:=1: s[2]:=2:    #   s[3]:=3:
for n from 3 to 30 do
s[n]:=s[n-1]+1/2*s[n-2]+1/6*s[n-3] od;

Wasn't this problem clarified in your previous https://www.mapleprimes.com/questions/226681-How-To-Plot-Multiple-Functions-In-One-Plot ?

Note that some of your functions (RootOfs) are discontinuous, and the option discont cannot change this (it only may remove some segments near the "jumps").

@D-V 

I suppose that you want to change the interval from [0,2*Pi]  to  [0,5], so that the period will be 5 (for the periodic extension of the function f restricted to [0,5]).
The formulae for the coefficients must be adapted:

restart;
a := (n,f,t1,t2)   -> 2/(t2-t1)*int(cos(2*Pi*n*t/(t2-t1))*f(t),t=t1..t2);
b := (n,f,t1,t2)   -> 2/(t2-t1)*int(sin(2*Pi*n*t/(t2-t1))*f(t),t=t1..t2);
S := (n,f,t1,t2,t) -> a(0,f,t1,t2)/2 + add(a(k,f,t1,t2)*cos(2*Pi*k*t/(t2-t1)) +
                                           b(k,f,t1,t2)*sin(2*Pi*k*t/(t2-t1)), k=1..n):

f:=t -> t^2;
plot([f(t),S(8,f,0,5,t)], t=0..5);

 

Note also:

periodic_extension := proc(f::procedure, t1, t2)
  proc(t) f(t - floor((t-t1)/(t2-t1))*(t2-t1)) end
end:

plot([periodic_extension(f,0,5)(t),S(8,f,0,5,t)], t=-5..15);

 

Are you an alias of guru kido    ? Same problem, hand written formulae?

There were a couple of replies in this thread (including mine) which you have deleted. Why?

@guru kido 

The problem is an iterative solver for a linear system.
There are many algorithms for this. For one them you already got a working code.
Why don't you present completely the algorithm you are trying to use now?

@Simon45 

Your code solves directly the problem using a "big" linear sistem in the unknowns y[k,j].
As I see you have the task to solve it using a sequence of tridiagonal linear "smaller" systems.
These methods are standard. You must look in your textbook or lecture notes and see how the equations can be arranged.
Or, you may google for "heat equation discretization".

@Rouben Rostamian  

After posting the solution I have also found Kurtz' article.
Note that "=" also can be used to find a simple sequence (with smaller 1/a[n]) namely:
a[n] = 2^( - n*(n - 1) ), n>0,  a[0]=1/2.

 


 

subsop(2=s,J)

replaces the second operand of J (which is  s = xi1 .. L1)  with   s.

See in the help file:
?subsop

@digerdiga

restart;

interface(version);

`Standard Worksheet Interface, Maple 2015.0, Windows 7, February 17 2015 Build ID 1022128`

(1)

f:=(coth(x)^(1/3)-tanh(x)^(1/3))*(coth(x)^(2/3)+tanh(x)^(2/3)+1)

(coth(x)^(1/3)-tanh(x)^(1/3))*(coth(x)^(2/3)+tanh(x)^(2/3)+1)

(2)

simplify(expand(f)) assuming x>0;

1/(sinh(x)*cosh(x))

(3)

 

@mimi990 

fun11 is actually a vector (of dimension 1) containing the integral. So, fun11[1]  is the integral itself.
The subsop converts the definite integral into an indefinite one.

@9009134 

This function is also non-periodic. 

In general, if two continuous nonconstant periodic functions f, g : R --> R have incommensurable periods (i.e. their ratio is irrational) then f + g is non-periodic.

I don't know what you mean by minimal period in this case; d is not periodic. The periods of the two terms are incommensurable, there is no common period.

@Kitonum 

It's impossible to get uniform approximations this way. E.g. for t=40800*Pi..40800*Pi+3  the difference is very large.

@mmcdara 

This is another function. OP says f(t)=t^2 for t in [0,2*Pi]. It has discontinuous periodic extension.
Yours is continuous.

First 63 64 65 66 67 68 69 Last Page 65 of 176