Items tagged with datatype datatype Tagged Items Feed

Hello Hello everybody 
   I have to solve the following differential equation numerically 


``

 

restart:with(plots):

mb:=765 : mp:=587 : Ib:=76.3*10^3 : Ip:=7.3*10^3 : l:=0.92 : d:=10: F:=490: omega:=0.43 :

eq1:=(mp+mb)*diff(x(t),t$2)+mp*(d*cos(theta(t))+l*cos(alpha(t)+theta(t)))*diff(theta(t),t$2)+mp*l*cos(alpha(t)+theta(t))*diff(alpha(t),t$2)+mp*(d*diff(theta(t),t)^2*sin(theta(t))+l*(diff(theta(t),t)+diff(alpha(t),t))^2*sin(alpha(t)+theta(t)))-F*sin(omega*t)=0;

1352*(diff(diff(x(t), t), t))+587*(10*cos(theta(t))+.92*cos(alpha(t)+theta(t)))*(diff(diff(theta(t), t), t))+540.04*cos(alpha(t)+theta(t))*(diff(diff(alpha(t), t), t))+5870*(diff(theta(t), t))^2*sin(theta(t))+540.04*(diff(theta(t), t)+diff(alpha(t), t))^2*sin(alpha(t)+theta(t))-490*sin(.43*t) = 0

(1)

eq2:=(mp+mb)*diff(z(t),t$2)-mp*d*(sin(theta(t)+alpha(t))+sin(theta(t)))*diff(theta(t),t$2)-mp*l*sin(alpha(t)+theta(t))*diff(alpha(t),t$2)+mp*(d*diff(theta(t),t)^2*cos(theta(t))+l*(diff(theta(t),t)+diff(alpha(t),t))^2*cos(alpha(t)+theta(t)))+9.81*(mp+mb)-F*sin(omega*t)=0;

1352*(diff(diff(z(t), t), t))-5870*(sin(alpha(t)+theta(t))+sin(theta(t)))*(diff(diff(theta(t), t), t))-540.04*sin(alpha(t)+theta(t))*(diff(diff(alpha(t), t), t))+5870*(diff(theta(t), t))^2*cos(theta(t))+540.04*(diff(theta(t), t)+diff(alpha(t), t))^2*cos(alpha(t)+theta(t))+13263.12-490*sin(.43*t) = 0

(2)

eq3:=mp*(d*cos(theta(t))+l*cos(alpha(t)+theta(t)))*diff(x(t),t$2)-mp*(l*sin(theta(t)+alpha(t))+d*sin(theta(t)))*diff(z(t),t$2)+(Ip+Ib+mp*(d^2+l^2)+2*mp*d*l*cos(alpha(t)))*diff(theta(t),t$2)+[Ip+mp*l^2+mp*d*l*cos(alpha(t))]*diff(alpha(t),t$2)-mp*sin(alpha(t))*(l*d*diff(alpha(t),t)^2-l*d*(diff(alpha(t),t)+diff(theta(t),t))^2)+mp*9.81*l*sin(alpha(t)+theta(t))+mp*9.81*d*sin(theta(t))=0;

587*(10*cos(theta(t))+.92*cos(alpha(t)+theta(t)))*(diff(diff(x(t), t), t))-587*(.92*sin(alpha(t)+theta(t))+10*sin(theta(t)))*(diff(diff(z(t), t), t))+(142796.8368+10800.80*cos(alpha(t)))*(diff(diff(theta(t), t), t))+[7796.8368+5400.40*cos(alpha(t))]*(diff(diff(alpha(t), t), t))-587*sin(alpha(t))*(9.20*(diff(alpha(t), t))^2-9.20*(diff(theta(t), t)+diff(alpha(t), t))^2)+5297.7924*sin(alpha(t)+theta(t))+57584.70*sin(theta(t)) = 0

(3)

eq4:=mp*l*cos(alpha(t)+theta(t))*diff(x(t),t$2)-mp*l*sin(alpha(t)+theta(t))*diff(z(t),t$2)+(Ip+mp*l^2+mp*d*l*cos(alpha(t)))*diff(theta(t),t$2)+(Ip+mp*l^2)*diff(alpha(t),t$2)-mp*9.81*l*sin(alpha(t)+theta(t))+l*d*mp*diff(theta(t),t$1)^2*sin(alpha(t))=0;

540.04*cos(alpha(t)+theta(t))*(diff(diff(x(t), t), t))-540.04*sin(alpha(t)+theta(t))*(diff(diff(z(t), t), t))+(7796.8368+5400.40*cos(alpha(t)))*(diff(diff(theta(t), t), t))+7796.8368*(diff(diff(alpha(t), t), t))-5297.7924*sin(alpha(t)+theta(t))+5400.40*(diff(theta(t), t))^2*sin(alpha(t)) = 0

(4)

CI:= x(0)=0,z(0)=0,theta(0)=0,alpha(0)=0,D(x)(0)=0,D(alpha)(0)=0,D(z)(0)=0,D(theta)(0)=0;

x(0) = 0, z(0) = 0, theta(0) = 0, alpha(0) = 0, (D(x))(0) = 0, (D(alpha))(0) = 0, (D(z))(0) = 0, (D(theta))(0) = 0

(5)

solution:=dsolve([eq1,eq2,eq3,eq4, CI],numeric);

Error, (in f) unable to store '[0.]/(0.17571268341557e16+[-0.25659510610770e15])' when datatype=float[8]

 

 

 

I don't know why it says : Error, (in f) unable to store '[0.]/(0.17571268341557e16+[-0.25659510610770e15])' when datatype=float[8]

 

Help pleaase!

thank you !!!

Download systéme_complet.mw

 

The result of the following lines in Maple is V := [5., 3.,5. 11., 6.] that I think should be V := [5., 3.,5. 0., 6.], is there somthing wrong?

 

v1:= Vector([-28., -63., -17., -55., 17.], datatype= float[8]):

V:= LinearAlgebra:-Modular:-Mod(11, v1, float[8]);

bug.mw



In ode solve command i generated a large array data. The output shows a large order matrix of this form

 

[110001x6 Matrix

Datatype:Anything

Storage:rectangular

order:Fortran_order].

 

I want to export this matrix into a notepad. Which can then be used for plotting in TecPlot. 

 

Looking for good response

 

 

Dear Maple users

I have a question, which is probably very basic, but I can't find how to handle it in the Programming Manual or elsewhere. I need to declare a parameter, which is a vector of lists. Example of element:

< [3,7,2,4], [-3,6,8,0], [-5,8,4,2]>

Vector has n components and each list has k components. I tried declaring it like:

boxVector:=Vector(n,datatype=list());

and other ways, but it didn't work. How can it be done?...

Thank you for the suggestions. Float command helped me a lot for real matrices but when I have imaginary numbers in my matrix it gives me error.  

 after I construct the matrix A I do = implies  Af:= Matrix(A, datatype= float):

 

That gives me error message ' Unable to store 0.-18844.3412345686*I ' when datatype=sfloat'    is there a solution for that like complex_float "? I  looked at Maple help but I could not find...

Hello,

I am trying to force Maple to read big matrices from files, produced by other programs (GAP in my case).

 

The output looks like this after it's been saved in a *.txt file:

[ [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,

I have an Array which storage consist ot other arrays with different datatypes...so my question is: Is there a way to protect this Array from being scaned from the garbage collection? I've got that if an array is saved as hardware float datatype it wont be touched from the gc, but how to do it when the datatype is not a hardware float? Might be something like MapleGcProtect, but not for external calls !!!

Thanks in advance.

Hi guys,

i solve the equations of motion for a triple pendulum(Eq17,Eq27,Eq28). After that, I applied numerical values and initial conditions to solve these equations numerically. But unfortunatially i get the following error.

> g := 9, 81; l[1] := 5; l[2] := 3; l[3] := 1; m[1] := 5; m[2] := 3; m[3] := 1;
> ini := `&varphi;`[1](0) = (1/3)*Pi, (D(`&varphi;`[1]))(0) = 0, `&varphi;`[2](0) = (2/3)*Pi, (D(`&varphi;`[2]))(0) = 0, `&varphi;`[3...

Interesting behavior!!

> restart
> N := 150; L := LinearAlgebra[RandomVector](N);

                              150

> st := time(); for j to 10^4 do ArrayTools[SearchArray](`~`[`=`](L, max(L))) end do; time()-st;

             ...

Hi all,

I wonder if it makes sense to use tables as datatype for efficient maple code. I need this datatype to pass parameters to a procedure which is called many times.

In particular, I have the following criteria:

* efficient (fast) to access for read and write.

* potentially thread save ( I can also imagine having individual copies for each thread)

* present in future Maple versions

* easy to transform into C-code later

how to override Array type? Want workaround next behaviour for float array:

a:=Array(1..10,datatype=float)

a[1]:=((2)^(4/9)+sqrt(2));
Error, unable to store 't^(4/9)+2^(1/2)' when datatype=sfloat

i.e. to call convertor before assignment. Can i principally to do so?

And yes, no hfloats. I need sfloat. Sow in help that some types could be created like objects (stack, queue etc).

I need a power regression function and I need it to be accurate, look what happens

> X := Vector([1, 2, 3, 4, 5, 6], datatype = float);

> Y := Vector([1, 4, 9, 16, 25, 36], datatype = float);
> PowerFit(X, Y, x);

(1.9999999999999998)
(1.0000000000000004) x
> f(x):=1.*x^2.;( using CTRL+L to get the result)

1.9999999999999998

I wrote some code involving chrem that broke in a recent version.

> y := Vector([0]):
> yp := Vector([1]):
> trace(chrem);
> chrem( [y, yp], [1,3] );
{--> enter chrem, args = [Vector(1, [...], datatype = anything), Vector(1, [...], 
datatype = anything)], [1, 3]
n := 2

v, m := [0], 1

v := 0

Hi there. I have two expressions of type Matrix(7x1), one I entered directly and the other one is the result of a  procedure calling. They only differ by the term [1,1], so when I do a comparation of the appropiate submatrix using Equal I get a positive answer:

 

>Equal(SubMatrix(atataaV(1,1,1,1,u1),2..-1,1),SubMatrix(u1,2..-1,1));

true

 

Now, the elements of the submatrices depend on the symbol 'n',...

Am I missing some justification for this last one?

> zip(`/`,Array([3]),Array([9]));
                                     [1/3]
 
> zip(`/`,Array([3],datatype=integer[4]),Array([9]));
                                     [1/3]
 
> zip(`/`,Array([3]),Array([9],datatype=integer[4]));
                                     [1/3]
 
> zip(`/`,Array([3],datatype=integer[4]),Array([9],datatype=integer[4]));
                            [0.333333333333333315]
Page 1 of 1