cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

14-Alexandrite

## Odesolve (?) error

I am using Odesolve to solve a system of ODE's with a boxcar forcing function that starts at 1 goes to 10 and and I would like to return to 1. If I set the return value at 1.5, everything is fine. I I reduce it to, say, 1.2 I get the (to me, cryptic) error "The return value of this function must match the problem size."  (see attached worksheet). Can someone help me out.

7 REPLIES 7
17-Peridot
(To:JohnRudnicki)

Right-click on Odesolve and choose, say Adams/BDF (or anything other than Radau) and it works ok with llim = 1

(also, perhaps vhat(t):=1+9*(phi(t-1)-phi(t-5)) might be a neater way of defining vhat - though this doesn't help Radau to work).

Alan

14-Alexandrite
(To:AlanStevens)

Thanks. (I think you gave me similar advice a while ago on a similar issue. My excuse: I use MathCad sporadically and my memory is not what it used to me)

John

9-Granite
(To:JohnRudnicki)

Hi John.

Well, actually you have a bigger problem there: you plot for v(t) starts in 0, but in the solve block it is stated that v(0)=1. Same thing for U.

Best regards.

Alvaro.

25-Diamond I
(To:AlvaroDíaz)

> you plot for v(t) starts in 0, but in the solve block it is stated that v(0)=1.

This only looks that way in the plot because the ordinate is just showing beginning with 1. Seems to be all OK here:

> Same thing for U.

Why do you think so? The plot for U is not shown, but it starts at (0/0) as demanded:

Werner

9-Granite
(To:Werner_E)

Hi Werner.

You're right, U is OK, I confuse U with q4. But I see some problems in v even can't see where, but first place to check is the set of equations and initials conditions.

9-Granite
(To:JohnRudnicki)

Hi. Seems that issues are solved, this is, v(0)=1 for the plot, and works for any Ilim.

Best regards.

Alvaro.

14-Alexandrite
(To:AlvaroDíaz)

Thanks. John

Announcements

Top Tags