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
- :
- current value - past value

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-20-2020
02:02 PM

10-20-2020
02:02 PM

Hello,

in the scenario 5, I will need to do Tfi = alpha*Tn+(1-alpha)*Tf(i-1). which mean the new Tf value at time (i- 1). I'm not sure how to have that i-1 here in MathCad. Tn is calculated in scenario

I used i-1 vector subscript but it seems doesn't work

I really appreciate if you can help me to take a look this. Thank you so much!

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

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

10-20-2020
03:38 PM

10-20-2020
03:38 PM

Maybe like that:

Forget about t.i when you define your functions and use t.i just for plotting.

There also is no reason for defining i first an then writing t.i:=i (with a literal index). This would only result in t.i being the very same range as i. So you may just define t.i:= 2min, 2min+Delta t ... firsthand and use this range for plotting as you can see in the picture on the right. The plots look differently because of the random numbers. The plots also change every time you let the sheet recalculate (pressing F5).

4 REPLIES 4

Highlighted
##

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

10-20-2020
03:35 PM

10-20-2020
03:35 PM

Re: current value - past value

I'm surprised this worked:

A better way:

But the problem you may have is with using minutes as a subscript (and subtracting 1)

Highlighted
##

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

10-20-2020
04:00 PM

10-20-2020
04:00 PM

Re: current value - past value

@Fred_Kohlhepp wrote:

I'm surprised this worked:

It worked because when defining t.i := i a literal index is used. So t.i simply is the same range as i .

In the function definition vector indices were used and this could not work as t is not a defined vector and the index i is not dimensionless.

Highlighted

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

10-20-2020
03:38 PM

10-20-2020
03:38 PM

Maybe like that:

Forget about t.i when you define your functions and use t.i just for plotting.

There also is no reason for defining i first an then writing t.i:=i (with a literal index). This would only result in t.i being the very same range as i. So you may just define t.i:= 2min, 2min+Delta t ... firsthand and use this range for plotting as you can see in the picture on the right. The plots look differently because of the random numbers. The plots also change every time you let the sheet recalculate (pressing F5).

Highlighted
##

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

10-20-2020
09:04 PM

10-20-2020
09:04 PM

Re: current value - past value

Hello,

I actually did it already. It was i issue, I supposed to be numerical subscript. thank you so much everyone, project is done 🙂