C_R

1960 Reputation

19 Badges

6 years, 51 days

MaplePrimes Activity


These are replies submitted by C_R

@delvin

You are welcome.

I cannot reproduce the error. Which version did you use?

restart;

interface(version)

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

(1)

with(student):

U := a[0] + sum(-a[i]*tanh(xi[n])^i, i = 1 .. 1) + sum(-b[i]*tanh(xi[n])^(-i), i = 1 .. 1):

u(xi[n + 1]) := a[0] - a[1]*(tanh(xi[n]) + tanh(d))/(1 + tanh(xi[n])*tanh(d)) - b[1]*(1 + tanh(xi[n])*tanh(d))/(tanh(xi[n]) + tanh(d)):

u(xi[n - 1]) := a[0] - a[1]*(tanh(xi[n]) - tanh(d))/(1 - tanh(xi[n])*tanh(d)) - b[1]*(1 - tanh(xi[n])*tanh(d))/(tanh(xi[n]) - tanh(d)):

eq := c[1]^2*diff(U, xi[n], xi[n])*ln(1 + U/alpha) - beta*(u(xi[n + 1]) - 2*U - u(xi[n - 1])):

fin1 := simplify(numer(eq));

2*sech(xi[n])^2*c[1]^2*(tanh(d)*sech(xi[n])^2-tanh(xi[n])*sech(d)^2)*(tanh(d)*sech(xi[n])^2+tanh(xi[n])*sech(d)^2)*(tanh(xi[n])^4*a[1]-b[1])*ln((-a[1]*tanh(xi[n])+alpha+a[0]-b[1]*coth(xi[n]))/alpha)-2*beta*tanh(xi[n])^2*(-a[1]*sech(d)^4*tanh(xi[n])^4+(-tanh(d)*sech(xi[n])^2*b[1]*sech(d)^2+a[0]*sech(d)^4)*tanh(xi[n])^3+(tanh(d)^2*sech(xi[n])^4*a[1]-b[1]*sech(d)^4)*tanh(xi[n])^2-((tanh(d)*a[0]+a[1]+b[1])*sech(xi[n])^2-a[1]*sech(d)^2)*tanh(d)*sech(xi[n])^2*tanh(xi[n])+tanh(d)^2*sech(xi[n])^4*b[1])

(2)

fin := simplify(subs(tanh(xi[n]) = Psi, fin1));

-2*sech(xi[n])^2*c[1]^2*(-tanh(d)*sech(xi[n])^2+Psi*sech(d)^2)*(tanh(d)*sech(xi[n])^2+Psi*sech(d)^2)*(Psi^4*a[1]-b[1])*ln((-a[1]*Psi+alpha+a[0]-b[1]*coth(xi[n]))/alpha)+2*Psi^2*beta*(-(tanh(d)*(Psi^2*a[1]-Psi*a[0]+b[1])-Psi*(a[1]+b[1]))*tanh(d)*sech(xi[n])^4+sech(d)^2*tanh(d)*Psi*(Psi^2*b[1]-a[1])*sech(xi[n])^2+sech(d)^4*Psi^2*(Psi^2*a[1]-Psi*a[0]+b[1]))

(3)

degree(fin,Psi)

FAIL

(4)

FF:=convert(series(fin,Psi,7),polynom):

degree(%,Psi)

6

(5)

for i from 0 to degree(FF, Psi) do
    EQ[i] := simplify(coeff(FF, Psi, i));
end do

-2*sech(xi[n])^6*c[1]^2*tanh(d)^2*b[1]*ln((alpha+a[0]-b[1]*coth(xi[n]))/alpha)

 

2*sech(xi[n])^6*c[1]^2*tanh(d)^2*b[1]*a[1]/(alpha+a[0]-b[1]*coth(xi[n]))

 

b[1]*(a[1]^2*c[1]^2*tanh(d)^2*sech(xi[n])^6/(b[1]*coth(xi[n])-alpha-a[0])^2+2*sech(xi[n])^2*c[1]^2*sech(d)^4*ln((alpha+a[0]-b[1]*coth(xi[n]))/alpha)-2*beta*tanh(d)^2*sech(xi[n])^4)

 

(2/3)*b[1]*a[1]^3*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^3-2*sech(xi[n])^2*c[1]^2*sech(d)^4*b[1]*a[1]/(alpha+a[0]-b[1]*coth(xi[n]))+2*(a[0]*tanh(d)*sech(xi[n])^2+(a[1]+b[1])*sech(xi[n])^2-a[1]*sech(d)^2)*beta*sech(xi[n])^2*tanh(d)

 

(1/2)*b[1]*a[1]^4*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^4-b[1]*a[1]^2*c[1]^2*sech(d)^4*sech(xi[n])^2/(alpha+a[0]-b[1]*coth(xi[n]))^2+2*sech(xi[n])^6*c[1]^2*tanh(d)^2*a[1]*ln((alpha+a[0]-b[1]*coth(xi[n]))/alpha)+2*beta*(-tanh(d)^2*sech(xi[n])^4*a[1]+b[1]*sech(d)^4)

 

(2/5)*b[1]*a[1]^5*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^5-(2/3)*b[1]*a[1]^3*c[1]^2*sech(d)^4*sech(xi[n])^2/(alpha+a[0]-b[1]*coth(xi[n]))^3-2*sech(xi[n])^6*c[1]^2*tanh(d)^2*a[1]^2/(alpha+a[0]-b[1]*coth(xi[n]))-2*beta*sech(d)^2*(-b[1]*tanh(d)*sech(xi[n])^2+a[0]*sech(d)^2)

 

(1/3)*b[1]*a[1]^6*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^6-(1/2)*b[1]*a[1]^4*c[1]^2*sech(d)^4*sech(xi[n])^2/(alpha+a[0]-b[1]*coth(xi[n]))^4-a[1]^3*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^2-2*sech(xi[n])^2*c[1]^2*sech(d)^4*a[1]*ln((alpha+a[0]-b[1]*coth(xi[n]))/alpha)+2*beta*a[1]*sech(d)^4

(6)

Eqs := {seq(EQ[i]=0, i = 0 .. 6)}

{b[1]*(a[1]^2*c[1]^2*tanh(d)^2*sech(xi[n])^6/(b[1]*coth(xi[n])-alpha-a[0])^2+2*sech(xi[n])^2*c[1]^2*sech(d)^4*ln((alpha+a[0]-b[1]*coth(xi[n]))/alpha)-2*beta*tanh(d)^2*sech(xi[n])^4) = 0, -2*sech(xi[n])^6*c[1]^2*tanh(d)^2*b[1]*ln((alpha+a[0]-b[1]*coth(xi[n]))/alpha) = 0, 2*sech(xi[n])^6*c[1]^2*tanh(d)^2*b[1]*a[1]/(alpha+a[0]-b[1]*coth(xi[n])) = 0, (2/3)*b[1]*a[1]^3*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^3-2*sech(xi[n])^2*c[1]^2*sech(d)^4*b[1]*a[1]/(alpha+a[0]-b[1]*coth(xi[n]))+2*(a[0]*tanh(d)*sech(xi[n])^2+(a[1]+b[1])*sech(xi[n])^2-a[1]*sech(d)^2)*beta*sech(xi[n])^2*tanh(d) = 0, (1/2)*b[1]*a[1]^4*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^4-b[1]*a[1]^2*c[1]^2*sech(d)^4*sech(xi[n])^2/(alpha+a[0]-b[1]*coth(xi[n]))^2+2*sech(xi[n])^6*c[1]^2*tanh(d)^2*a[1]*ln((alpha+a[0]-b[1]*coth(xi[n]))/alpha)+2*beta*(-tanh(d)^2*sech(xi[n])^4*a[1]+b[1]*sech(d)^4) = 0, (2/5)*b[1]*a[1]^5*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^5-(2/3)*b[1]*a[1]^3*c[1]^2*sech(d)^4*sech(xi[n])^2/(alpha+a[0]-b[1]*coth(xi[n]))^3-2*sech(xi[n])^6*c[1]^2*tanh(d)^2*a[1]^2/(alpha+a[0]-b[1]*coth(xi[n]))-2*beta*sech(d)^2*(-b[1]*tanh(d)*sech(xi[n])^2+a[0]*sech(d)^2) = 0, (1/3)*b[1]*a[1]^6*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^6-(1/2)*b[1]*a[1]^4*c[1]^2*sech(d)^4*sech(xi[n])^2/(alpha+a[0]-b[1]*coth(xi[n]))^4-a[1]^3*c[1]^2*tanh(d)^2*sech(xi[n])^6/(alpha+a[0]-b[1]*coth(xi[n]))^2-2*sech(xi[n])^2*c[1]^2*sech(d)^4*a[1]*ln((alpha+a[0]-b[1]*coth(xi[n]))/alpha)+2*beta*a[1]*sech(d)^4 = 0}

(7)

 

Download 02_-_2023_no_error.mw

Maple 2021 seems to run on Windows 11.

https://www.mapleprimes.com/questions/233049-Has-Anyone-Try-Using-Maple-2021-In-Window-11-

This does not mean that 2020 will run similarly, as Maple 2021 uses a different Java platform than 2020. 

How is the mass distributed?

Rolling means no slippage possible?

@acer 

The progress bar is nice! It seems that there are some possibilities for the advanced user.

For beginners there should be something simple (easy to find/discover, understand and to use) when starting with loop statements in Maple. It does not have to be perfect.

A console window would be a great supplement to a simple solution. I would prefer separate windows.

I believe most people would prefer a solution where the output appears in a text area after the loop, ideally where repeated output from a loop typically appears. Something like that

restart;

with(DocumentTools):

with(DocumentTools:-Components):

with(DocumentTools:-Layout):

s := "0":

T := TextArea(s, identity = "TextArea0"):
xml := Worksheet(Group(Input(Textfield(T)))):

#insertedname:=InsertContent(xml)[1,1]:

box_printed:=false:
for i to 10 do
if (not(box_printed))then
   insertedname:=InsertContent(xml)[1,1]:
   box_printed:=true:
end if:
Threads:-Sleep(1);

DocumentTools:-SetProperty(insertedname,value,sprintf("%d",i),refresh=true);
end do:

Maplets:-Examples:-Message("Done");

Can't one of the print commands be modified to do this (i.e. avoid a line feed)? This would be much easier than learning DocumentTools.

At least there is a solution that would not have occurred to me. 👍

Download text-area-update-progress_after_loop.mw

L as used in line 3 is of dimension time. In line 4 you want L to be zero when the time is between 1 and 2 (days?).

Otherwise you want L, which is of dimension time, to be C, which is probably of a different dimension.

What you probably want is to define a piecewise function for C:

C:=piecewise(time condition,first concentration dosage 1, concentration dosage 1 + concentration dosage 2) where concentration of dosage 2 is timeshifted.

Concering C: Do you really want C to be a product of a constant and a time depended exponential term?

there is an Error before the plot comand

@tomleslie 

Its a single element list exported from

It looks like I have always been removing brackets from expressions when working manually, without realizing that it is a requirement for using isolate.

Thank you all for the quick response!

@Maxie 

You could try to adopt the following for your problem

https://www.mapleprimes.com/posts/220877-Ball-Bouncing-On-A-Flexible-Beam

 

@sursumCorda 

I was looking for something like that! 👍

 

@ecterrab Could you have a look if the output of Physics:-Substitute in the attached is as intended?

 

Another_way_with_Physics_Substitute.mws

@mmcdara 

I can’t see a better way without referring to advanced statements like applyrule. Thank you!

 That what i get with 2023

As an alternative to dharr's answer, which does the fit in mA, you could divide values in Y by 1000 do get results in A which fit to C in muF.

The book is correct. See the plots in my reply to dharr below

@dharr Just a check that the data is in mA. I have never used units and fits so I stopped after checking that the parameters fit to the data. So maybe your tweak with mF is not required.

restart

U := 100*Unit('V')

100*Units:-Unit(V)

(1)

R := 4900*Unit(Unit('Omega'))

4900*Units:-Unit(`Ω`)

(2)

C := 20*Unit('`μF`')

20*Units:-Unit(`μF`)

(3)

"v(t):=U/(R)*(e)^(-(t/(R*C)))"

proc (t) options operator, arrow, function_assign; U*exp(-t/(R*C))/R end proc

(4)

simplify(v(.1*Unit('s')))

0.7356077312e-2*Units:-Unit(A)

(5)

``

data := LinearAlgebra:-Transpose(`<,>`(`<|>`(.1, .2, .3, .4, .5), `<|>`(7.36, 2.7, .99, .37, .13)))

Matrix(%id = 36893489545658315588)

(6)

p1 := plot(data, style = point)

 

p2 := plot(v(t), t = .1*Unit('s') .. .5*Unit('s'), useunits = [s, mA])

 

plots[display](p1, p2)

 

``

NULL

Download Mapleprimes_Question_Book_2_Paragraph_5.12_Question_5_with_units.mw

@Carl Love 

Maple provides so many solutions, that I rarely need to code (and test) procedures.

In case I have to pass a function I will not try it make work a you said. Thank you for bringing this to my attention.

As for Fortran, I do not mis goto but I have kept a few punch cards that I use as bookmarks for sentimental reasons. I will see if I can find a goto card as physical proof that those statements were in use ;-)

First 16 17 18 19 20 21 22 Last Page 18 of 36