wingho

20 Reputation

2 Badges

0 years, 92 days

MaplePrimes Activity


These are replies submitted by wingho

@acer 

thank you.  Agree.  listplot is no frill and is good for simple 1D array plot against index.

@janhardo 

The code is a big help.  I found that the graphic of the solution looks suspicious.  I found the following warning in the output right before step 5.

Warning, (in apply_bc) `u_new` is implicitly declared local

 

When I copy and paste the code from the body of the procedure apply_bc in place of the procedure call, the response looks like the classic cosinusoidal response which I believe is correct.

As another reply pointed out correctly that the H function in my original worksheet was not time varying.  (I do not see that reply anymore.  Maybe it was deleted). It was meant to be H=650+100*sin(2*Pi*f0*n*dt) as part of H_total.  With that correction, it also went through the calculation without problem.

Finally, is your .mw file coded using the code region?  It looks different from code region and it does not take the tab key kindly.  

@janhardo 

Thank you for the quick and detail response.  A lot for me to chew on.  Will follow up if I have additional question.

@Rouben Rostamian  Sorry for the confusion.  Since I ran out of my trial license, I cannot open to see exactly what I have written. 

For the first file "pdsolve-c_variable_of_H.mw," if I remember correctly (counting on my memory is a risky business these days), I think I have tried c(H(t)) insteat of c(H) and get the same error (Error, (in pdsolve/numeric/process_PDEs) variable(s) {H} are in the PDE system but are not dependent or independent variables). 

The second file "pdsolve-c_variable_of_t.mw," I made the c as a function of t and replace all H with Ho, and specify Ho:=Hb+H2*sin(2*Pi*t).  The Hb is a dc bias to make c transition from one segment to another as H cycle through.  The logic of using Ho and not t is that I do not have to figure out the corresponding t's for transition which is based on H and it becomes impractical to calculate and specify all t's of one hundred cycles, even if Maple does not object.

You are right, I can maintain H and write H:=Hb+H2*sin(2*Pi*t) which should also do.  But that still would not overcome Maple's objection that the piecewise has to be based on t or x and not an expression of t.  I will try things out when I get my license back and report back.  

Thank you.  Here are the two worksheets as described in the original question.  The c(H) I attached is more abrupt between the segments than my model but it does demonstrate the difficulties I encounter.

pdsolve-c_variable_of_H.mw

pdsolve-c_variable_of_t.mw

@dharr nice. Thank you.  It certainly is on the help page.  The help page with the wealth of information is a bit overwhelming when you are new to Maple; went right past it.

Thank you for providing the answer.  I also find another approach that seems to work:

psol := pds:-value(output = listprocedure);
psol(0.0001, 0.1);

and to get the u(x,t) value:

solxt := eval(u(x, t), psol);
solxt(0.0001, 0.1);

Could have never dreamt this up.

Thank you for the quick response.  I am new to Maple.  There is quite a bit to digest and learn there.

Page 1 of 1