Items tagged with matlab matlab Tagged Items Feed

Hello all,

I am pretty new to Maple, but I am trying to understand something. I was able to find a numerical solution to a PDE in maple (with some community help, thanks guys!). I am trying to manipulate this data but am struggling with it. I thought if I could take this data to matlab it would be pretty easy for me to manipulate and do what I want. 

So my question is: How do I export my numerical solution (pds module) to matlab. Just taking the data is okay. I know you can evaluate the data at some points. 

 

I see there is "Matlab" command that converts code, it doesn't seem to like pds as an input though.

I also see an export matrix command. I guess it could be possible to create a matrix of plot data and convert it this way?

 

I had to do a change of coordinate system to solve the PDE because of boundary conditions. I'm trying to transform this data back to my regular x,y coordinate system to see if it matches some other simulations. 

Thanks in advance! And here is my file.


restart;
with(Physics):
Setup(mathematicalnotation = true):

V(Z, f);

If function ( varphi) is defined, use this one.

PDE1 := subs[inplace](x = xi*varphi(t), PDE1);
If function ( varphi) is defined, use this one.


PDE1 := subs[inplace](t = 2*vartheta*(1/omega), PDE1);


 

 

 

 

 

 

Thesis_Pde2_attempt.mw

                                                                                 

Hi everybody,

I have some experimental data from an oscillating system (time domaine) and I would like to get an approximation of the damping ratio (zeta). I have already try to use the half-power band width method with the vibrationdata Matlab package designed by Tom Irvine. But I would like to double-check the result with another method.

I found several methods in this paper and I would like to try to do the curve fitting method with the Curve Fitting Toolbox of Maple or Matlab (R2014b) (2.2.2 Curve fitting in the paper). data.txt

It's the first I use this Toolbox with a custom equation, so, I do not really know how to do it with my sample data.

Can anybody help me with this ? I have attached the .txt file sample data to this post.

Cheers

Dear all, I have obtained some figures in Maple code. But they looks not very good. Iwant to export the plot data to matlab. Then try to plot in matlab. I think it should't be very hard. Does anyone can help me? Thanks

Hello

Is there any option for impoting MATLAB's variables eith struct format (*.mat)?

Could you please to help me!

Thank you.

 

Good Day Everybody, I m new to maple and would like to translate the following for loop from Matlab to Maple. The FromMatlab Translater didnt work for this expression related to the matrix Q, A, B D and A1. Any help would be greatly appreciated.

Related Matlab Code:

...

Q(3,3)=2*Q(3,3);

 for i=1:length(R)

    T(1,1)=cos(R(i))^2; 

    T(2,2)=cos(R(i))^2; 

    T(1,2)=sin(R(i))^2; 

    T(2,1)=sin(R(i))^2; 

    T(3,1)=-sin(R(i))*cos(R(i)); 

    T(3,2)=sin(R(i))*cos(R(i)); 

    T(1,3)=2*sin(R(i))*cos(R(i)); 

    T(2,3)=-2*sin(R(i))*cos(R(i)); 

    T(3,3)=cos(R(i))^2-sin(R(i))^2;

    T1(1,1)=cos(R(i)); 

    T1(1,2)=-sin(R(i)); 

    T1(2,1)=sin(R(i)); 

    T1(2,2)=cos(R(i));

    

    Qk(:,:,i)=inv(T)*Q*T; 

    Qk(:,3,i)=Qk(:,3,i)/2; 

    Qk1(:,:,i)=inv(T1)*Q1*T1;

    A=A+Qk(:,:,i)*(h(i+1)-h(i)); 

    B=B+.5*Qk(:,:,i)*(h(i+1)^2-h(i)^2); 

    D=D+1/3*Qk(:,:,i)*(h(i+1)^3-h(i)^3); 

    A1=A1+Qk1(:,:,i)*(h(i+1)-h(i));

end

Thanks a lot in advance.

Hello people

i have a quetion

what is the perposes of these softwares,maple,matlab,mathmatica and latex.

for example i listened from somewhere that matlab is best for matrices, then what are the major task of these softwares which i listed above including matlab,

how we make comparison of these softwares.

thanks

 

Is there a way to convert this FDTD code into Maple

Hy(1 to M)=0;

Ex(1 to M+1)=0;

For t=1 to T,

Ex(1)=exp(-t);

For k=1 to M,

Hy(k)=Hy(k)-(Ex(k+1)-Ex(k));

end

For k=2 to M,

Ex(k)=Ex(k)-(Hy(k)-Hy(k-1));

end

end

Thanks in advance.

Hello,

From a simulation software, I obtain in a matlab file my differential equations in the following way :

C_p_e = C_state/C_c;
C_p_f = I_state/I_i;
R_p_e = R_r*C_p_f;
I_p_e = (Se_p_e-R_p_e)-C_p_e;

For theses expressions, I would like to do two operations :
1) Transform it into equations
2) Conduct substitutions so as to change the names of the variables with nicer names.

For this objectives, I could do with the following code:

restart;
eq1:=C_p_e = C_state/C_c;
eq2:=C_p_f = I_state/I_i;
eq3:=R_p_e = R_r*C_p_f;
eq4:=I_p_e = (Se_p_e-R_p_e)-C_p_e
allsubs:= proc(XX )
subs(C_p_e=fs(t),C_p_f=v(t),R_p_e=fd(t),I_p_e=fm(t),C_c=1/k,I_i=m,R_r=c,Se_p_e=fe(t),I_state=int(fm(t),t),C_state=int(v(t),t),XX)
end proc:
eq1_a:=allsubs(eq1);
eq2_a:=allsubs(eq2);
eq3_a:=allsubs(eq3);
eq4_a:=allsubs(eq4);

Now, I would like to automatisation the creation of the equations eq1, eq2, eq3, eq4. For the moment, to create these equations, I have done copy/ paste from matlab.

But, I would like to create these equations eq1, eq2, eq3, eq4 with a automative process from my matlab equations. The reason comes from the fact that I would like to make the same work on bigger system which are composed with numerous equations.

How can I create equations labeled eq1, ...eqn from a list of expressions from matlab ?

Thank you for your help

Hello,

I am trying to medel a mechanical system using parametric relations. Unfrotunately in some cases, the relations and equations become too lengthy. Maple calculates the relations but when I try to convert them to MATLAB language an error message appears. I have uploaded corresponding file in maple. As can be seen in this file, an error message appeard after trying to convert to MATLAB language. In some cases, for example C22, the relations are too length so that maple cannot show them. Do you have any idea to overcome this problem?

Thanks in advance.

P1.mw

 

why can not draw graph in maple in this case and how to plot graph with matlab in maple

with(StringTools);
with(FileTools);
with(Matlab);
openlink();
evalM(sprintf("load fisheriris;X = meas(:,3:4);figure;plot(X(:,1),X(:,2),'k*','MarkerSize',5);"));
closelink();

 

how to call matlab to run k means on the data and

how to show which circle do the row of data belong to?

The help of maple software is not so clear , and I cant understand the exact way which leads to exporting a matrix from maple to matlab. more precisely how I can link between maple and matlab .

would you please with an example show me the rule.

hello everyone, I have problem in my project written by matlab to solving my equations with rang-kuta 4 order method. I send my project file.  please help me to run it correctly. thank you.

input Q_j n j V Z F_ve a_1 a_2 p_1 p_2 L A f m k c h t i;

for jj=1:n;

            s=Q_j(jj);

end

b=(-V)*Z;

o=(F_ve*A)*(((a_1^2)*p_1)-((a_2^2)*p_2))/L;

% RK4 method;

% md2z/dt2+cdz/dt+kz=f;

% dz_1/dt=z_2;

% mdz_2/dt+cdz_1/dt+z_1k=f;

% dz_2/dt=1/m(f-cz_2-kz_1);

f=0;

m=1;

k=s+b+o;

c=0;

h=0.5;

t=0:0.5:t;

z1=zeros (1,n);

z2=zeros (1,n);

z1 (1)=0;

z2 (1)=1;

% N=length (t);

f1=@(t,z1,z2)z2;

f2=@(t,z1,z2)f-(c*z2)-(k*z1);

for i=1:n-1;

    k1=f1 (t (i),z1 (i),z2 (i));

    m1=f2 (t (i),z1 (i),z2 (i));

    k2=f1 (t (i)+h/2,z1 (i)+0.5*k1*h,z2 (i)+0.5*m1*h);

    m2=f2 (t (i)+h/2,z1 (i)+0.5*k1*h,z2 (i)+0.5*m1*h);

    k3=f1 (t (i)+h/2,z1 (i)+0.5*k2*h,z2 (i)+0.5*m2*h);

    m3=f2 (t (i)+h/2,z1 (i)+0.5*k2*h,z2 (i)+0.5*m2*h);

    k4=f1 (t (i)+h,z1 (i)*k3*h,z2 (i)*m3*h);

    m4=f2 (t (i)+h,z1 (i)*k3*h,z2 (i)*m3*h);

    z1 (i+1)=z1 (i)+(h/6)*(k1+(2*k2)+(2*k3)+k4);

    z2 (i+1)=z2 (i)+(h/6)*(m1+(2*m2)+(2*m3)+m4);

end

plot (t,z1)

plot (t,z2)

plot (z,t)

 

 

 

 

Hello,

 

I wonder if it is possible to create standalone executables in Maple that would run in a  computer without Maple. Also if it is possible can we do that with Matlab code in it too?  

 

Matlab does not allow to create standalone executable is you use symbolic toolbox and I want to find a solution for that. What I will need to take second derivatives and get the coefficients of polynomials. 

I have been puzzled by a matlab toolbox problem for a long time. How can I get Maple notation in matlab output?

Both "Input display" and "Output display" in Tools-->Options-->Display was changed from "2-D Math notation" into "Maple notation". And the output in Maple is indeed Maple notation like this:maple output

But the output in matlab is also 2-D notation like this:matlab output

when copy it to Matlab or Maple as input, it become the wrong issues like this:wrong style

How can I output Maple notation in matlab? The version is Maple 18 and Matlab 2014b, respectively.

 

 

1 2 3 4 5 6 Page 1 of 6