Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- ODESolve with a limit

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-20-2018
08:44 PM

03-20-2018
08:44 PM

Here's a simple model of an electric motor. It works fine but I'd like to solve it with an added complication - a limit that current can only be 10A or less. I couldn't figure out how to do it. Any ideas?. (4.0 attached)

Thanks,

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
02:03 PM

03-21-2018
02:03 PM

That's the problem with typing in a problem from a picture. Correct solution attached.

21 REPLIES 21

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
07:20 AM

03-21-2018
07:20 AM

Re: ODESolve with a limit

With the values given at the top table and the initial conditions you apply the solution you get is the only one possible, I guess.

So if you want a different outcome you will have to change a couple of those values or at least one of them. You will have to tell which values are possible candidates to be changed and which are not.

Then you can turn your odesolveblock into a function of those values, create a function giving you the maximal current for given values and use a solve block to optimize those values until the maximal current is 10 A.

Here is an example of what I am talking about. For simplicity I just make the inductance *L* a changeable value (which might not make sense for your model). If you can change more than one value, you would do it likewise, but you should throw in some additional constraints in the second solve block (otherwise Prime will only play with one of those values and leave the other unchanged.

BTW, you don't need to provide the guess value L=0.002 H in the second solve block as you already had defined a value for L at the top table, but I like to have all things nice and tidy where the are needed, so I added the guess for completeness.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
08:45 AM

03-21-2018
08:45 AM

Re: ODESolve with a limit

Thanks Werner. I see I wasn't clear in my question (it's always harder to state than one would think.) The situation would be that a device is added that actually restricts current to 10A. So, it'd flatline like shown below. Easy enough to do in another program (simulink) but I was trying to repeat it in mathcad - as a learning exercise.

.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
09:05 AM

03-21-2018
09:05 AM

Re: ODESolve with a limit

Thats easy enough to achieve when its OK to simply apply this restriction on the result of the solve block using an if statement or the if function:

But I guess its not that easy as you would like to apply that restriction already in your solve block, also affecting the other functions, right?

So the differential equations would not apply for the full range of t and the result would be a function not differentiable at distinct points. Not sure how this would affect the differential equations in use.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
09:34 AM

03-21-2018
09:34 AM

Re: ODESolve with a limit

Here's another approach to your motor:

Of course the solution(s) run much further to the right...

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
09:47 AM

03-21-2018
09:47 AM

Re: ODESolve with a limit

What kind of (electrical?) component that should limit the current are you thinking of?

And what do you think will actually happen with the motor when you deprive it of current it (apparently) wants/needs?

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
10:19 AM

03-21-2018
10:19 AM

Re: ODESolve with a limit

I though there was an error in your set of equations (I was wondering why you defined k.t and never used it.)

The 'error' is in the second equation.

T(t)=i(t)*n/k.s should be T(t)=i(t) *n*k.t

If not the dimensions aren't correct. (You define a boundary condition where T(0) = 0 N m. That only happens when T(t)=i(t) *n*k.t, not when T(t)=i(t)*n/k.s.

Glancing once more I found that k.t = 1/k.s, and the units come out correctly, sort of by accident: because N*m=W*s.

The correct unit for a torque (which is what T(t) should be, I guess) however is N*m, one should never use W*s (or J=Joule) for a torque.

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
11:18 AM

03-21-2018
11:18 AM

Re: ODESolve with a limit

After fixing the error Luc pointed out:

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
11:33 AM

03-21-2018
11:33 AM

Re: ODESolve with a limit

Fred,

This result (as well as the simulink example of the OP) doesn't seem right.

Why would the current be 10 A right from the start, when, without the limiter, it reaches 10 A only after about 3 ms?

Your system behaves like motor that is started on 10 A current which is kept until it no longer needs it.

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-21-2018
11:41 AM

03-21-2018
11:41 AM

Re: ODESolve with a limit

Careful! In order to capture the overshoot, I lengthened the time from 0.1 to 2 seconds. If I expand the start on the current window, the current ramps to 10 amps in 3 msec. (Difference is tolerance?)

Top Tags