Items tagged with convert convert Tagged Items Feed

Hi,

I have a problem with dsolve in the following code

restart;
>
n:=20;
m:=1;
cc:=-200;
zzeta:=0.1;
sefr1:=0.3;
sefr:=0.2;
MM:=0;
lambda:=0.1;
Br:=1;
nn:=3;
>
>
#u(tau):=tau;
u(tau):=421.7129935*tau-2217.587728*tau^2+8897.376593*tau^3-27612.59182*tau^4+64248.00336*tau^5-1.083977605*10^5*tau^6-10.57029600-1.080951714*10^6*tau^13+7.999517316*10^5*tau^14-4.788741005*10^5*tau^15+2.309563748*10^5*tau^16+26511.11102*tau^18-5959.001794*tau^19+1.148523882*10^5*tau^7-95.23809524*tau^21+4.545454545*tau^22-9435.563781*tau^8-2.587683745*10^5*tau^9+6.473880128*10^5*tau^10+948.0272727*tau^20-88660.41892*tau^17-1.008692404*10^6*tau^11+1.175504242*10^6*tau^12;
>
>
B := 1+(2*(1-zzeta))*Br*(int(tau*(diff(u(tau), tau))^2, tau = (1/2)*zzeta*(1-zzeta) .. 1/2*(1-zzeta)));
eq4 := 4*B*u(tau)-(1+zzeta)*(diff(tau*(diff(theta(tau), tau)), tau))/tau-(1+zzeta)*Br*(diff(u(tau), tau))^2;


theta(tau):=sum(p^ii*theta[ii](tau),ii=0..nn);
HH:= p*((4*(1+(2*(1-zzeta))*Br*(int(tau*(diff(u(tau), tau))^2, tau = (1/2)*zzeta*(1-zzeta) .. 1/2-(1/2)*zzeta))))*u(tau)-(1+zzeta)*(diff(theta(tau), tau)+tau*(diff(theta(tau), tau, tau)))/tau-(1+zzeta)*Br*(diff(u(tau), tau))^2)+(1-p)*(diff(theta(tau),tau$2)):
eq5:=simplify(HH):
eq6:=collect(expand(eq5),p);

eq7:=
convert(series(collect(expand(eq5), p), p, nn+1), 'polynom');


for ii to nn do
ss[ii] := (coeff(eq7, p^ii)) ;
print (ii);
end do;

ss[0]:=diff(theta[0](tau), tau, tau);

icss[0]:=theta[0](zzeta/(2*(1-zzeta)))=0, D(theta[0])(1/(2*(1-zzeta)))=1;

dsolve({ss[0], icss[0]});
theta[0](tau):= rhs(%);


for ii to nn do
ss[ii]:=evalf[5](ss[ii]);
icss[ii]:=theta[ii](zzeta/(2*(1-zzeta)))=0, D(theta[ii])(1/(2*(1-zzeta)))=0;
dsolve({ss[ii], icss[ii]});
theta[ii](tau):=rhs(%);
end do;

I would be most grateful if you help me to find this problem.

Thanks for your attention in advance

 

Dear all

I would like to convert Matlab code to Maple, is there anu idea, this is the code.

 

% Usage: [y t] = abm4(f,a,b,ya,n) or y = abm4(f,a,b,ya,n)
% Adams-Bashforth-Moulton 4-th order predictor-corrector method for initial value problems
% It uses
% Adams-Bashforth 4-step method as a precdictor,
% Adams-Moulton 3-step method as a corrector, and
% Runge-Kutta method of order 4 as a starter
%
% Input:
% f - Matlab inline function f(t,y)
% a,b - interval
% ya - initial condition
% n - number of subintervals (panels)
%
% Output:
% y - computed solution
% t - time steps
%
% Examples:
% [y t]=abm4(@myfunc,0,1,1,10);          here 'myfunc' is a user-defined function in M-file
% y=abm4(inline('sin(y*t)','t','y'),0,1,1,10);
% f=inline('sin(y(1))-cos(y(2))','t','y');
% y=abm4(f,0,1,1,10);

function [y t] = abm4(f,a,b,ya,n)
h = (b - a) / n;
h24 = h / 24;

y(1,:) = ya;
t(1) = a;

m = min(3,n);

for i = 1 : m % start-up phase, using Runge-Kutta of order 4
    t(i+1) = t(i) + h;
    s(i,:) = f(t(i), y(i,:));
    s2 = f(t(i) + h / 2, y(i,:) + s(i,:) * h /2);
    s3 = f(t(i) + h / 2, y(i,:) + s2 * h /2);
    s4 = f(t(i+1), y(i,:) + s3 * h);
    y(i+1,:) = y(i,:) + (s(i,:) + s2+s2 + s3+s3 + s4) * h / 6;
end;

for i = m + 1 : n % main phase
    s(i,:) = f(t(i), y(i,:));
    y(i+1,:) = y(i,:) + (55 * s(i,:) - 59 * s(i-1,:) + 37 * s(i-2,:) - 9 * s(i-3,:)) * h24; % predictor
    t(i+1) = t(i) + h;
    y(i+1,:) = y(i,:) + (9 * f(t(i+1), y(i+1,:)) + 19 * s(i,:) - 5 * s(i-1,:) + s(i-2,:)) * h24; % corrector
end;

number10:=`466d06ece998b7a2fb1d464fed2ced7641ddaa3cc31c9941cf110abbf409ed39598005b3399ccfafb61d0315fca0a314be138a9f32503bedac8067f03adbf3575c3b8edc9ba7f537530541ab0f9f3cd04ff50d66f1d559ba520e89a2cb2a83`:

number8:=`315c4eeaa8b5f8bffd11155ea506b56041c6a00c8a08854dd21a4bbde54ce56801d943ba708b8a3574f40c00fff9e00fa1439fd0654327a3bfc860b92f89ee04132ecb9298f5fd2d5e4b45e40ecc3b9d59e9417df7c

I first define

f:=x->convert(x, decimal, hex):

with(Bits):
str1:=convert( `Xor(f(number8), f(number10))`, bytes);

now how can I get back the alphabets, since again use of convert with bytes return the inital argument.

Moreover, I would really appreciate if someone could explain the difference between 

convert(`expr`, bytes)

convert( [expr], bytes)

 

Many regards!!

 

As the title, how to convert "sin(x)+cos(x)" and this kinds into "sqrt(2)*sin(x+pi/4)"?

Sum of two sine functions with the same cycle should can be converted into one sine function, with some amplitude gain and phase offset. 

 

> assume(a < 0);
> convert(cosh(sqrt(a)), sincos);
print(`output redirected...`); # input placeholder
/ (1/2)\
cos\(-a) /

This is what I expected.

Now

> assume(L > 0);
> assume(K > 0);
> assume(mu > 0);
> assume(mu^2 < 4*L*k);
> assume(t > 0);
> convert(cosh((1/2)*t*sqrt(mu^2-4*L*k)/L), sincos);
print(`output redirected...`); # input placeholder
/ (1/2)\
| / 2 \ |
|t \mu - 4 L k/ |
cosh|--------------------|
\ 2 L /

I wanted to obtain again the cos function. Could someone help me?
(What is the reason that convert does not work "well" in later case?)

 Thanks,  Sandor

 

Is it possible that this expression has an elementary one (specifically the dilog's):

Y0:=(1/16)*(s*t*(exp(2*t)*s+exp(4*t)+1)*ln((exp(2*t)*s-(-s^2+1)^(1/2)+1)^16*(1+(-s^2+1)^(1/2))^16/((exp(2*t)*s+(-s^2+1)^(1/2)+1)^16*(1-(-s^2+1)^(1/2))^16))+s^3*t*(exp(4*t)+1)*ln((exp(2*t)*s-(-s^2+1)^(1/2)+1)^8*(1+(-s^2+1)^(1/2))^8/((exp(2*t)*s+(-s^2+1)^(1/2)+1)^8*(1-(-s^2+1)^(1/2))^8))+exp(2*t)*t*ln((exp(2*t)*s-(-s^2+1)^(1/2)+1)^32*(1+(-s^2+1)^(1/2))^32/((exp(2*t)*s+(-s^2+1)^(1/2)+1)^32*(1-(-s^2+1)^(1/2))^32))+4*((exp(4*t)+1)*s+2*exp(2*t))*(s^2+2)*dilog((-exp(2*t)*s+(-s^2+1)^(1/2)-1)/(-1+(-s^2+1)^(1/2)))-4*((exp(4*t)+1)*s+2*exp(2*t))*(s^2+2)*dilog((exp(2*t)*s+(-s^2+1)^(1/2)+1)/(1+(-s^2+1)^(1/2)))+((32*s^2*t+64*t)*exp(2*t)+16*(((t+1/8)*s^2+2*t+2)*exp(4*t)-(5/4)*s*exp(-2*t)-(1/8)*exp(-4*t)*s^2+(5/4)*s*exp(6*t)+(1/8)*s^2*exp(8*t)+(t-1/8)*s^2-2+2*t)*s)*arctanh((exp(2*t)-1)*(-1+s)/((-s^2+1)^(1/2)*(exp(2*t)+1)))+8*(-s^2+1)^(1/2)*((1/8)*s*(exp(4*t)+1)*ln((exp(4*t)*s+2*exp(2*t)+s)^12/s^12)+(1/8)*exp(2*t)*ln((exp(4*t)*s+2*exp(2*t)+s)^24/s^24)+(s^2-6*t-3)*exp(2*t)+((-(1/8)*s^2-3*t)*exp(4*t)+s*exp(-2*t)+(1/8)*exp(-4*t)*s^2+s*exp(6*t)+(1/8)*s^2*exp(8*t)-(1/8)*s^2-3*t)*s))/((s*exp(-2*t)+exp(2*t)*s+2)*(exp(4*t)*s+2*exp(2*t)+s)*((-s^2+1)^(1/2)+2*arctanh((-1+s)/(-s^2+1)^(1/2))))

Also I'm wondering since Y0 should solve the ode

-(diff(diff(y(t), t), t))+(4-12/(1+s*cosh(2*t))+8*(-s^2+1)/(1+s*cosh(2*t))^2)*y(t) = C/(1+s*cosh(2*t))

with some constant C but I only get rubbish.

I ask this because I found that in another context this seems to be correct:

f1:=-(1/12)*Pi^2*((-s^2+1)^(1/2)-arccosh(1/s))/(-s^2+1)^(3/2)+(1/12)*arccosh(1/s)^3/(-s^2+1)^(3/2)-(1/4)*arccosh(1/s)^2/(-s^2+1)

f2:=(1/2)*((-s^2+1)^(1/2)*(polylog(2, s/(-1+(-s^2+1)^(1/2)))+polylog(2, -s/(1+(-s^2+1)^(1/2))))-polylog(3, s/(-1+(-s^2+1)^(1/2)))+polylog(3, -s/(1+(-s^2+1)^(1/2))))/(-s^2+1)^(3/2)

and f1=f2

but maple doesnt convert it.

Also maple has trouble to convert

2*arctanh(sqrt((1-s)/(1+s)))=arccosh(1/s)

everywhere: 0<s<1

hi,

     there is a common  differential equation in my maple note,the solution of the eq. can be expressed by

associated Legendre function(s),but i get a result by hypergeometric representation.how i can translate the later into a  single Legendre fun?

 Thank you in advance  

ode := 'sin(theta)*(diff(sin(theta)*(diff(Theta(theta), theta)), theta))'/Theta(theta)+l*(l+1)*sin(theta)^2 = m^2

sin(theta)*(diff(sin(theta)*(diff(Theta(theta), theta)), theta))/Theta(theta)+l*(l+1)*sin(theta)^2 = m^2

(1)

dsolve(ode)

Theta(theta) = _C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)/(1-cos(2*theta))^(1/2)+_C2*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/(1-cos(2*theta))^(1/2)

(2)

`assuming`([simplify(dsolve(ode))], [l::posint, m::integer, l >= m])

Theta(theta) = ((1/2)*cos(2*theta)-1/2)^((1/2)*m)*(sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)*_C1+2^(1/2)*(1-cos(2*theta))^(1/2)*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*_C2)/(1-cos(2*theta))^(1/2)

(3)

convert(Theta(theta) = _C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)/(1-cos(2*theta))^(1/2)+_C2*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/(1-cos(2*theta))^(1/2), `2F1`)

Theta(theta) = (1/2)*_C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*Pi^(1/2)*GAMMA(-(1/2)*m-(1/2)*l)*JacobiP(-(1/2)*m-(1/2)*l-1, 1/2, m, -cos(2*theta))/((1-cos(2*theta))^(1/2)*GAMMA(1/2-(1/2)*m-(1/2)*l))+_C2*Pi^(1/2)*GAMMA(1-(1/2)*m+(1/2)*l)*JacobiP(-(1/2)*m+(1/2)*l, -1/2, m, -cos(2*theta))*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/((1-cos(2*theta))^(1/2)*GAMMA(-(1/2)*m+(1/2)*l+1/2))

(4)

``

 

Download question_12.19.mw

 

It would be nice if Maple had a procedure which could turn a procedurelist into a listprocedure.
I use these words in the sense they are used in dsolve/numeric.
Thus by a procedurelist I mean a procedure returning lists (of numbers).
By a listprocedure I mean a list of procedures all having the same formal parameters and each returning one number.
Thus a `convert/listprocedure`should accept a procedurelist p as input and give as output the corresponding listprocedure [p1,p2, ... pN] where N is the number of elements in the output from p.

I tried making a `convert/listprocedure` myself and in doing so found that it was not totally trivial.
I had lots of problems but did end up with something that seems to work.

convert-listprocedur.mw

But my main point is that Maple ought to have some such facility either as described available to the user or by changing fsolve, complexplot or what have you, so that procedurelists are accepted.

Hello.

I am novice here and I have an question about export animations frames into sequence of postscript files. I don't googled nothing about this theme.
Here is my question:

Is there an option to convert the animated picture into  sequence of separate images and then (eg using the program cycle) save this images as separate PostScript images? I know the possibility of exporting to GIF file and then converting them into PS file. But I do not have a PS file with a sequence of bitmap images. I would sufficed for me to be able to see a separate frame of animation (through any index).

Thanx Jaroslav Hajtmar

Hi All,

 

I tried to convert the following hypergeometric function into BesselJ function. But I failed to do so. Could any one let me know the  reference or procedure to convert the Hypergeom function into bessel function.

 

Following is the integral I am intended to do.

Result:

I need to convert the result into equivalent bessel function.

 

If at all there is a way to co-relate the generalized corelation between bessel function <-> hypergeom function.

 

Direct me to any books you come across.

 

Thanks

 

I have a vector that looks like this:

"GOOG.NASDAQ_A.4"
"GOOG.NASDAQ_AAC.4"
"GOOG.NASDAQ_AACC.4"

Now in order to make the api call it has to be expressed as:

http://quandl.com/api/v1/multisets.csv?columns=GOOG.NASDAQ_A.4,GOOG.NASDAQ_AAC.4,GOOG.NASDAQ_AACC.4

or as:

"http://quandl.com/api/v1/multisets.csv?columns=GOOG.NASDAQ_A.4,GOOG.NASDAQ_AAC.4,GOOG.NASDAQ_AACC.4"


How would I make that transformation?
It looks simple but it is difficult ie string notation and you cant copy past (thousands of stocks). 

LL_101)_Quandl_Get_D.mw

Hello ...

how to convert matrix to single code like below


for example ,a:=

 

how i want to combine a like b:= 00000001111000111100000110011001110101010101

 

accroding to http://www.maplesoft.com/support/help/Maple/view.aspx?path=convert%2fVector  set can't be converted to Vector.

So I have to convert set to list, then convert the list to a Vector:

a:={1,2}:
convert(convert(a,list),Vector);

I was wondering if there is a short way to type this or a command that I might have overlooked, as it seems too much typing for such a common operation. (it would be nice if convert would support this automatically by doing the above so one can just type convert(a,Vector).  I am using Maple 17.02. I googled around, and did not find anything.

On a side note: The reason I ask, is that dsolve and many other operations like it, return the solutions as a set. Many times I need to multiply this by a Matrix. Hence the conversion need.

I have list for a:=[11110, 10101,100,10101], but, this list i want assume that all number is base 2..
so, how i want to convert to base 10?

Hello....

how to convert decimal to binary??
for example [10, 3,90,6]..
how to convert this number into binary??

1 2 3 4 5 6 7 Last Page 2 of 37