Items tagged with data data Tagged Items Feed

Hi :)

I have a Macbook Air running on OS X Mavericks. I am using Maple16.

I created a procedure, which construct two keys. Each of those keys consists of a list containing two elements. That is two primes. So at the end of my procedure I included the following code in order to write my data to a file:

> pkey := fopen(keyFile, WRITE, TEXT);
                      pkey:=1
> writedata(pkey, publicKey);
> fclose(pkey);

The problem is that I can't find the created file "keyFile".

So I tried breaking the problem down. I created a List and wanted to write that list in a textfile in a specific folder:

> L := [1, 2, 3];
> fd := fopen("Users\\****\\Desktop\\fdtest.txt", WRITE, TEXT);
                              fd:=1
> fprintf(fd, "This is a test");
                              14
> fclose(fd);

But this did not work either. It seems like the file fdtest.txt never gets created. This happens in general when I use fopen().

Thank you in advance for your help

Schloemilch

 

 

I have some data for a model in MapleSim that I would like to use a time look up table with.  I've found that the two options for interpolation are linear and 1st derivative, but the data was intended to be interpretted as piecewise constant.  Is there any way to acheive this option in MapleSim?

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

 

i have a non linear equation that depends on three variables e, theta and z.

i have done calculations to calculate e while varying theta and z. theta varied among the vector [0, Pi/4, Pi/3, Pi/2] and z was varying between 1 and 20

when plotting my data it gives the following plot where z is represented on the x-axis and each curve correspond to one theta

 

i am currently able of fitting one plot to one equation i would like to fit the data points using the nonlinearfit function and to only get one equation for all the plots. is that possible in maple or not

 

Hi,

I have a code compute some function : 

         alpha1:(n, m,1) -> (n + 1) (int(K(|m h - y|), y = n h .. (n + 1) h))

              int(K(|m h - y|) y, y = n h .. (n + 1) h)
            - -----------------------------------------
                                  h                    
         alpha2:  (n, m,2) -> -n (int(K(|m h - y|), y = n h .. (n + 1) h))

                int(K(|m h - y|) y, y = n h .. (n + 1) h)
              + -----------------------------------------
                                    h                    
and  I have a Matrix "MatA" .

 

 

My aim, when I give the value of the Kernel K used in alpha1, and alpha2, like K(x,y)=ln|x-y| , I want a numerci Matrix.

How can I do it.

Many thinks.

Fred.mw

 

Hello;

I would like to extract data from a 2D plot to compare my numerical result in Matlab. 

I used this command.

However, I need to spesify the nodes on x axis to get the error in Matlab. My matlab codes give the result as fix step size i.e [0 0.1 0.2 ... 1.0] or [0 0.01 0.02 ... 1.00] etc.

Is there any command in Maple to spesify the nodes on x axis?

Thanks you!

Hi everybody,

I have never done statistics in Maple.  In a simple calculation, I need to calculate the RMS of 55 numbers.  The average of those numbers is 100484.3 and it is given that the RMS is 1.28 counts.  I have the a list of the 55 numbers.  Since I don't need a demonstration, it would help me a lot if you could tell me how to load the data from a *.txt file (one number per line), and use the appropriate commands to obtaine the result that is only given.

For the moment, I only need the steps to proceed with the calculations and how to do it in Maple.

Thank you very much in advance for your help.

 

--------------------------------------
Mario Lemelin
Maple 18 Ubuntu 13.10 - 64 bits
Maple 18 Win 7 - 64 bits messagerie : mario.lemelin@cgocable.ca téléphone :  (819) 376-0987

I am recently using maple to plot poincare surface of section, and when I do the harmonic hamiltonian I need to fix different values of p1,q1,p2 and q2 in a tyler series expansion. So i'm expected to use the numbers from a txt file to caculate the tyler series expansion. But after i realize the "readdata" code, i don't know what to do next...

Can anybody tell me how to operate those data please?

Thank you very much!

By the way, I'm not a native English speaker, if my question is unclear please ask me for confirming...

Hi

 

I have some data:

Matrix(10, 2, {(1, 1) = 0, (1, 2) = 0, (2, 1) = .5, (2, 2) = 3.25, (3, 1) = 1.0, (3, 2) = 5.82, (4, 1) = 1.5, (4, 2) = 7.50, (5, 1) = 2.0, (5, 2) = 8.79, (6, 1) = 2.5, (6, 2) = 9.83, (7, 1) = 3.0, (7, 2) = 10.66, (8, 1) = 3.5, (8, 2) = 11.35, (9, 1) = 4.0, (9, 2) = 11.94, (10, 1) = 4.5, (10, 2) = 12.46})

 

I want Maple to make a trendline fitting a Logarithmic function. I can make it output some function with this:

LeastSquares(`<,>`(.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5), `<,>`(3.25, 5.82, 7.50, 8.79, 9.83, 10.66, 11.35, 11.94, 12.46), x, curve = a+b*ln(x))

It outputs:

5.96497783539274+4.25309474196387*ln(x)

 

But please notice, the dataset in the function does not have the first 0 and 0. If i do that:

LeastSquares(`<,>`(0, .5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5), `<,>`(0, 3.25, 5.82, 7.50, 8.79, 9.83, 10.66, 11.35, 11.94, 12.46), x, curve = a+b*ln(x))

It outputs: 

Error, (in Matrix) numeric exception: division by zero

 

Besides that, i need the R-squard value for determinating how well it fits.

 

If i do the same thing i Excel the data set will give a formular: 5.5464ln(x)-0.2175 with a R-sward value of 0.9985.

 

How can i do this i maple?

 

Thanks in Advance!

 

----

Emil Kristensen

Dear All,

I have a simple question, Thanks of your remarks

I would like to find the slope of a line:

 

I Want to find the slope of this line. How????

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

 

 

Hi there!

I wrote a piece of code which spits out the numerical datapoints (x,y(x)) corresponding to a function y(x). So that the result is accurate, I need quite a lot of data points - currently I am working with 5k.

In order to work with this function later, I interpolated it with a Spline. For instance, I would like to sample the function values on a fifferent grid, etc.. However the evaluation of this function really takes up hell of a lot of time, and the reason seems to be, that it, being a spline on 5k nodes, is simply a huge expression.

Is there a better way to do this? Are other fitting functions than a spline maybe better suited?

Thanks for help!

 

Hi,

plot([[F(0,0.8)(y),y,y=0..3],[F(0.1,0.8)(y),y,y=0..3],[F(0.2,0.8)(y),y,y=0..3]],numpoints=25,color=[red,green,blue],view=[-0.3..0.5,0..2.5]);

p1:=%:

data:=plottools:-getdata~([p1]):

dm1:=op([1,-1],data);

              dm1 := Vector(4, {(1) = ` 36 x 2 `*Matrix,

                        (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

dm2:=op([2,-1],data);

           dm2 := Vector(4, {(1) = ` 32 x 2 `*Matrix,

                    (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

dm3:=op([3,-1],data);

                       dm3 := Vector(4, {(1) = ` 28 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage:                                         `*rectangular, (4) = `Order: `*Fortran_order})

How to combine these three matrices into a single one with four columns (y, F(0,0.8)(y), F(0.1,0.8)(y), F(0.2,0.8)(y) )?

 

Thanks

 

Dear All,

 

I have a .txt file with a single line. I tried to import it using ImportMatrix commnad (e.g. ImportMatrix(filename)) but always got the incomplete data, 

I attach the file for further reference:

ConservationEq.txt 

 

Anything I am missing ?

 

Regards,

 

Satya

I have a programme which examine how well a particular set of data fits a theoretical function.

In fact, I faced a problem : the programme returns only one solution and I guess in an arbitrary way.

I would like to find a way to define an interval in which the programme seeks solutions .

How can I do so?

 

with (Optimization)
[ImportMPS, Interactive, LPSolve, LSSolve, Maximize, Minimize, NLPSolve,QPSolve];


data := [[2.954488^2, 1.644900e-5], [3.132092^2,1.614900e-5], [3.307416^2, 1.594200e-5], [3.471311^2, 1.550700e-5], [3.559775^2, 1.450200e-5], [3.669332^2, 1.499400e-5], [3.825572^2, 1.476900e-5], [3.962449^2, 4.133000e-8], [4.200714^2, 1.320900e-5],
[4.434636^2, 1.433400e-5], [4.638319^2, 1.259100e-5], [4.832908^2, 1.258500e-5], [5.078484^2,
1.216200e-5], [5.315167^2, 1.164300e-5], [5.662155^2, 1.131000e-5], [5.916080^2, 1.082400e-5],
[6.208865^2, 1.054800e-5], [6.526868^2, 1.002600e-5], [6.880407^2, 1.006200e-5], [7.243618^2, 9.594000e-6], [7.607233^2,
9.288000e-6], [7.916439^2, 8.958000e-6], [8.320457^2, 8.664000e-6], [8.721812^2, 8.439000e-6], [9.007774^2, 8.325000e-6], [8.721812^2, 8.439000e-6], [9.007774^2,8.325000e-6], [9.393083^2, 7.878000e-6], [9.668506^2, 7.755000e-6], [9.988994^2,7.623000e-6], [10.40192^2, 7.367000e-6], [10.94532^2, 6.928000e-6], [11.38244^2,6.812000e-6], [11.85200^2, 6.720000e-6], [12.18811^2, 6.422000e-6], [12.67281^2, 6.403000e-6], [12.96341^2,6.514000e-6], [13.49185^2, 6.032000e-6], [13.76590^2, 6.103000e-6], [14.4072^2,6.143000e-6], [14.45476^2, 6.095000e-6], [14.76313^2, 5.758000e-6], [15.09868^2,6.965000e-6]]:

f:= x -> abs(((2*(c*exp(-b*1.5e-6)/(2*150*(c^2-((1+I)*(sqrt(3.14*x/8.5e-5)))^2)))*(2*(((1-I)*c/(2*(sqrt(3.14*x/8.5e-5))))-((0.026/150)*sqrt(8.5e-5/2e-5)))*exp(-c*0.5e-3)+((1+((0.026/150)*sqrt(8.5e-5/2e-5)))*(1-((1-I)*c/(2*(sqrt(3.14*x/8.5e-5)))))*exp(((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3))-((1-((0.026/150)*sqrt(8.5e-5/2e-5)))*(1+((1-I)*c/(2*(sqrt(3.14*x/8.5e-5)))))*exp(-((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3)))+(b/(2*a*(b^2-((1+I)*(sqrt(3.14*x/9e-6)))^2)*((2*(1-((0.026/150)*sqrt(8.5e-5/2e-5)))*(1+((1-I)*b*a/(2*(sqrt(3.14*x/8.5e-5))*150)))*exp(-((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3-b*1.5e-6))-(2*(1+((0.026/150)*sqrt(8.5e-5/2e-5)))*(1-((1-I)*b*a/(2*(sqrt(3.14*x/8.5e-5))*150)))*exp(((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3-b*1.5e-6))-((1-((0.026/150)*sqrt(8.5e-5/2e-5)))*(1-((a/150)*sqrt(8.5e-5/9e-6)))*(1-((1-I)*b*a/(2*(sqrt(3.14*x/8.5e-5))*150))/((a/150)*sqrt(8.5e-5/9e-6)))*exp(-((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3+((1+I)*(sqrt(3.14*x/9e-6)))*1.5e-6))-((1-((0.026/150)*sqrt(8.5e-5/2e-5)))*(1+((a/150)*sqrt(8.5e-5/9e-6)))*(1+((1-I)*b*a/(2*(sqrt(3.14*x/8.5e-5))*150))/((a/150)*sqrt(8.5e-5/9e-6)))*exp(-((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3-((1+I)*(sqrt(3.14*x/9e-6)))*1.5e-6))+((1+((0.026/150)*sqrt(8.5e-5/2e-5)))*(1+((a/150)*sqrt(8.5e-5/9e-6)))*(1-((1-I)*b*a/(2*(sqrt(3.14*x/8.5e-5))*150))/((a/150)*sqrt(8.5e-5/9e-6)))*exp(((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3+((1+I)*(sqrt(3.14*x/9e-6)))*1.5e-6))+((1+((0.026/150)*sqrt(8.5e-5/2e-5)))*(1-((a/150)*sqrt(8.5e-5/9e-6)))*(1+((1-I)*b*a/(2*(sqrt(3.14*x/8.5e-5))*150))/((a/150)*sqrt(8.5e-5/9e-6)))*exp(((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3-((1+I)*(sqrt(3.14*x/9e-6)))*1.5e-6))))/(((1-((0.026/150)*sqrt(8.5e-5/2e-5)))*exp(-((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3))*(((1-((a/150)*sqrt(8.5e-5/9e-6)))*(1+((0.026/150)*sqrt(8.5e-5/2e-5))/((a/150)*sqrt(8.5e-5/9e-6)))*exp(((1+I)*(sqrt(3.14*x/9e-6)))*1.5e-6))+((1+((a/150)*sqrt(8.5e-5/9e-6)))*(1-((0.026/150)*sqrt(8.5e-5/2e-5))/((a/150)*sqrt(8.5e-5/9e-6)))*exp(-((1+I)*(sqrt(3.14*x/9e-6)))*1.5e-6)))-((1+((0.026/150)*sqrt(8.5e-5/2e-5)))*exp(((1+I)*(sqrt(3.14*x/8.5e-5)))*0.5e-3))*(((1+((a/150)*sqrt(8.5e-5/9e-6)))*(1+((0.026/150)*sqrt(8.5e-5/2e-5))/((a/150)*sqrt(8.5e-5/9e-6)))*exp(((1+I)*(sqrt(3.14*x/9e-6)))*1.5e-6))+((1-((a/150)*sqrt(8.5e-5/9e-6)))*(1-((0.026/150)*sqrt(8.5e-5/2e-5))/((a/150)*sqrt(8.5e-5/9e-6)))*exp(-((1+I)*(sqrt(3.14*x/9e-6)))*1.5e-6)))))))*((1+I)*(sqrt(3.14*x/2e-5)))*exp(-190e-6*((1+I)*(sqrt(3.14*x/2e-5))))):


residuals := map(p -> (f(p[1])-p[2]), data):
R:= LSSolve(residuals);

 

1 2 3 4 5 6 7 Page 1 of 7