Scott03

744 Reputation

10 Badges

15 years, 3 days

MaplePrimes Activity


These are answers submitted by Scott03

It appears that the problem comes from the variable rh that comes up in equations 3 and 4.  Was that suppose to be rho?

Scott
Application Developer
Maplesoft

This isn't the only way you can do this but here is one way that should work.  I have started with an example of the odeplot from the help page.

> with(plots);
> p := dsolve({y(0) = 1, (D(y))(x) = y(x)}, type = numeric, range = -5 .. 2);
> P1 := odeplot(p):

Now you have stored the odeplot in the variable P1.  Now use the op command to take out the data from the plot structure.

> op([1, 1], P1);

Make sure that the above is an array in your case.  If that is the case the following line will convert that Array to a Matrix and use the ExportMatrix command to export the data as a tab delimited file

> ExportMatrix("C:\\Test\\Mydata.txt", convert(op([1, 1], P1), Matrix), target = delimited, delimiter = "\t");
 

Scott
Application Developer
Maplesoft

The cause of the problem is that the result for ifactor(r) in your case produces only one number (2).  Therefore asking for op(2,p) will fail.  You may want to test the size of p before you call op so that you don't ask for an element that is outside of the size of the parameter.

Scott
Application Developer
Maplesoft

Could you upload the worksheet to show how far you have gone so far? Also, could you provide the version of Maple that you have.

In general you can use the return statement to control what your procedure returns.

Scott
Application Developer
Maplesoft

If you save the plot as a variable, you can use plots:-pointplot3d to produce adots you want and then use plots:-display to display the resulting plot.

Plot1:=PlotPositionVector(pv, lat = VectorCalculus:-`-`(VectorCalculus:-`*`(Pi, 1/2)) .. VectorCalculus:-`*`(Pi, 1/2), lon = VectorCalculus:-`-`(Pi) .. Pi):

plots:-display([Plot1, plots:-pointplot3d([seq(seq([VectorCalculus[`*`](VectorCalculus[`*`](VectorCalculus[`*`](VectorCalculus[`*`](2, sqrt(2)), cos(lat)), sin(VectorCalculus[`*`](1/2, lon))), 1/sqrt(VectorCalculus[`+`](1, VectorCalculus[`*`](cos(lat), cos(VectorCalculus[`*`](1/2, lon)))))), VectorCalculus[`*`](VectorCalculus[`*`](sqrt(2), sin(lat)), 1/sqrt(VectorCalculus[`+`](1, VectorCalculus[`*`](cos(lat), cos(VectorCalculus[`*`](1/2, lon)))))), 0], lon = VectorCalculus[`-`](1) .. 1), lat = VectorCalculus[`-`](1) .. 1)], colour = red)]);

Scott
Application developer
Maplesoft

Once you have converted those systems of equations into a Matrix, you should be able to use the LinearAlgebra[Determinant] or Student[LinearAlgebra][Determinant] functions get the solution.  If you get stuck you can try this following this document (http://web2.slc.qc.ca/mh/Math105/Systems%20of%20Linear%20Equations%20with%20Maple.pdf).  The document is using the older linalg package but it isn't difficult to change the commands being used to use the better LinearAlgebra package.

Scott
Application Developer
Maplesoft

 

The answer as to why you are getting the numbers 0 and 17 comes from the commands that you are executing.  If you look at the commands you are executing, the fopen is returning the 0 and fprintf is returning the 17.

Looking at the help page for fopen you will find
     "Opens the file with the specified name for buffered reading or writing as specified by mode and returns a file descriptor (a small integer)."
and the help page for fprintf says the following
     "The fprintf command returns a count of the number of characters written.  Due to different character encodings, this number may differ from the number of bytes written to disk."

Scott
Application Developer
Maplesoft

Would this work for you?

EDP := [diff(u(x, t), t) = -.35*(diff(u(x, t), x))];
IBC := {u(0, t) = u(10, t), u(x, 0) = f(x)};
f := x -> piecewise(x = 5, 1, 0);
 

PDS := pdsolve(EDP, IBC, u, numeric, time = t, range = 0 .. 10):
 

Uplot := PDS:-plot(u(x, t), x = 2, t = 0 .. 10, numpoints = 50):
plots[display](Uplot);

This seems to work on my machine for Maple 13.02.

Scott
Application Developer
Maplesoft

Could you provide a worksheet showing what you entered (so that we can see if you are using the correct Pi and exp instead of e.  Also, what version of Maple are you using?

Scott
Application Developer
Maplesoft

For Maple, there is no student or professional versions of the program.  So you would have the same packages that other Maple users of the same version would have.  The only commands you wouldn't have would be commands that are included in any toolboxes.  For the statistics package, you would be able to use the with command without the space between with and the open parenthesis.

 

Scott
Application Developer
Maplesoft

Could you provide us with the function that you are using and if possible the rotation angles (found at the top) that are causing this cut off.  You may also want to try updating your Maple 11 to Maple 11.02.  I am not sure if this was fixed in that update, but it would mean that you have the last update for Maple 11.

Scott
Application Developer
Maplesoft

Could you explain what you mean by an arrow at the beginning of the next line?  If you mean the > character, either press the enter key (which will execute the line you are on and add a new line after) or press Ctrl+J for a new line (with the > character) on the next line.

Scott
Application Developer
Maplesoft

Could you either upload the worksheet that isn't giving any value or paste the full code.  Remember to do the with(Student[VectorCalculus]): before running the LineInt command.

Scott
Application Developer
Maplesoft

Here is one way to do this with LineInt from the VectorCalculus package

with(Student[VectorCalculus]):
SetCoordinates( cartesian[x,y] ):
LineInt( VectorField( <x-y,x*y> ), Path( <t,5/2-(13/12)*t-(3/4)*t^2+(1/3)*t^3>, t=-2..2 ) );

-10999/945

Scott
Application Developer
Maplesoft

One way that you can distinguish between these types of systems is by looking at the components (and their underlying equations found on the help pages).  For example any of the boolean, digital or switches would be a discrete block/system.  You can also attach the equations template to the model and if click on the "Get Discrete Equations" and "Get Boolean Equations" buttons and get any equations for you system/subsystem, then you have a discrete or hybrid system.

If you are having trouble with a certain model, please contact our technical support and we should be able to get some more information for you.

Scott
Application Developer
Maplesoft

3 4 5 6 7 8 9 Last Page 5 of 30