Carl Love

Carl Love

20278 Reputation

24 Badges

8 years, 110 days
Mt Laurel, New Jersey, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

Does this line have a typo?

X := : Y := Matrix(2): Z := Matrix(2):

Or is there some new syntax that I'm not aware of?

Does this line have a typo?

X := : Y := Matrix(2): Z := Matrix(2):

Or is there some new syntax that I'm not aware of?

Nice trick with the color= white. A variation is to add the option transparency= 0 to the second plot.

Nice trick with the color= white. A variation is to add the option transparency= 0 to the second plot.

@JamesK 

I know:P.....I've also tried Tree := Tree, {whattype(expr)},{whattype(elem)}; but I get the same error...what can I do?

A set cannot have two copies of the same element. But you can make a copy of a symbol which looks the same but is essentially different. You do this with convert(..., `local`). Example

{A,A};
                              {A}
b:= convert(A, `local`);
                               A
{A,b};
                             {A, A}

You can make any number of copies this way. A string cannot be copied like this. This is why I labeled the vertices with symbols instead of strings in my FunctionToTree.

@JamesK 

I know:P.....I've also tried Tree := Tree, {whattype(expr)},{whattype(elem)}; but I get the same error...what can I do?

A set cannot have two copies of the same element. But you can make a copy of a symbol which looks the same but is essentially different. You do this with convert(..., `local`). Example

{A,A};
                              {A}
b:= convert(A, `local`);
                               A
{A,b};
                             {A, A}

You can make any number of copies this way. A string cannot be copied like this. This is why I labeled the vertices with symbols instead of strings in my FunctionToTree.

@JamesK I see....What do you recommend I should do?

To answer that simplistically: Anything can be converted to a string with convert(..., string) or sprintf("%a", ...); anything can be converted to a symbol with convert(..., symbol) or nprintf("%a", ...).

But since I know where you're going with this, I suggest that you study closely my FunctionToTree module in the other recent thread here. You're going to encounter exactly the same problems that I did when writing that, even though you're not first applying ToInert.

@JamesK I see....What do you recommend I should do?

To answer that simplistically: Anything can be converted to a string with convert(..., string) or sprintf("%a", ...); anything can be converted to a symbol with convert(..., symbol) or nprintf("%a", ...).

But since I know where you're going with this, I suggest that you study closely my FunctionToTree module in the other recent thread here. You're going to encounter exactly the same problems that I did when writing that, even though you're not first applying ToInert.

@JamesK 

I replaced Tree := Tree, {whattype(elem),elem} with Tree := Tree, {whattype(elem)} and I get the following output and error :

Error, (in GraphTheory:-Graph) invalid edge/arc: {2}

Well, of course. Every edge needs two vertices.

@JamesK 

I replaced Tree := Tree, {whattype(elem),elem} with Tree := Tree, {whattype(elem)} and I get the following output and error :

Error, (in GraphTheory:-Graph) invalid edge/arc: {2}

Well, of course. Every edge needs two vertices.

@STHence 

Is there any way that Maple only solves first 9 equations and then substitutes the resluts to the last equation at each instant? 

Like I said, I already did solve it for only the first 9 equations. Doing so, each "instant" would take on the order of 53 minutes of CPU time. So if the integration uses, say, 200 evaluation points, then that could take a week or more. (Although there may be a "learning" effect where subsequent evaluation points take less time.)

Update: In addition, without last ODE, by using "eliminate" function in order to remove lambda 1 and lambda 2 from the equations, Maple can solve first 9 ODEs without any errors or warning.

Like I said, the dsolve itself ran fine in 22 seconds. It is using the results of the dsolve that takes a lot of time.

There's a chance that increasing the error tolerances and settings Digits to, say, 4 will make it run significantly faster. I don't have much hope for this approach though. It might be possible to simplify the equations after the eliminate and before the dsolve. And it might be possible to apply a code optimizer like codegen[optimize] to the procedure that dsolve returns.

@STHence 

Is there any way that Maple only solves first 9 equations and then substitutes the resluts to the last equation at each instant? 

Like I said, I already did solve it for only the first 9 equations. Doing so, each "instant" would take on the order of 53 minutes of CPU time. So if the integration uses, say, 200 evaluation points, then that could take a week or more. (Although there may be a "learning" effect where subsequent evaluation points take less time.)

Update: In addition, without last ODE, by using "eliminate" function in order to remove lambda 1 and lambda 2 from the equations, Maple can solve first 9 ODEs without any errors or warning.

Like I said, the dsolve itself ran fine in 22 seconds. It is using the results of the dsolve that takes a lot of time.

There's a chance that increasing the error tolerances and settings Digits to, say, 4 will make it run significantly faster. I don't have much hope for this approach though. It might be possible to simplify the equations after the eliminate and before the dsolve. And it might be possible to apply a code optimizer like codegen[optimize] to the procedure that dsolve returns.

@shorty101 

> How would one determine these?

There has to be some context in the original problem for them. For example, if a problem says "A gun is fired straight up from a height of 10 m with an initial velocity of 500 m/s. What is the height H(t) of the projectile at time t?" then the initial conditions are H(0) = 10 and H'(0) = 500.

> Cause I use maple to assist with this?

Once you determine the initial conditions, Maple can help with solving for the constants.

You should post the entire original problem and your call to dsolve. It's hard to believe that you are dealing with Mathieu functions with three parameters and six constants of integration and yet you had to ask those two questions. So my guess is that you've entered the problem incorrectly into dsolve.

@shorty101 

> How would one determine these?

There has to be some context in the original problem for them. For example, if a problem says "A gun is fired straight up from a height of 10 m with an initial velocity of 500 m/s. What is the height H(t) of the projectile at time t?" then the initial conditions are H(0) = 10 and H'(0) = 500.

> Cause I use maple to assist with this?

Once you determine the initial conditions, Maple can help with solving for the constants.

You should post the entire original problem and your call to dsolve. It's hard to believe that you are dealing with Mathieu functions with three parameters and six constants of integration and yet you had to ask those two questions. So my guess is that you've entered the problem incorrectly into dsolve.

Great that you have access to a later version, because I was about to write a downgrade for Maple 13. Try it out on your desired Int and diff commands, although I clearly see the need for some mods to get shorter labels.

First 540 541 542 543 544 545 546 Last Page 542 of 570