- a summation block, adding up the right hand side, and taking the reciprocal value
- the output goes into an integrator block that outputs y, which is the solution and also feeds back into the summation block

65 views (last 30 days)

how to model this equation in simulink dx/dy + x + y = 1

Mischa Kim
on 18 Dec 2016

Edited: Mischa Kim
on 18 Dec 2016

Re-write as

dx/dy = 1 - x - y % y is your independent variable, sort of "t"

therefore

dy/dx = 1/(1 - x - y)

Then, from left to right (in your Simulink block diagram) you have

- a summation block, adding up the right hand side, and taking the reciprocal value
- the output goes into an integrator block that outputs y, which is the solution and also feeds back into the summation block

John BG
on 18 Dec 2016

BACK TO BASICS

.

here I am using the grey background to highlight functions, not MATLAB code.

.

Misha and Basa,

the usage of 1/u in Misha's solution, in this context is erroneous, let me show you why:

1.- one of the possible solutions to dx/dy+y+x-1=0 is

x=1-exp(-y)

2.- inverting x(y)

x=1-exp(-y)

ln(1-x)=-y

so we have

y=-ln(1-x), or ln(|1-x|)

the 1st key point you need to understand is that d(y)/dx is not a division operator, it's a convention to express derivative, which is an operator that generally speaking does not comply with

if u=f(v) d(f(v),v)=k

let be v=g(u)

it's not generally correct assume d(g(u),u)=k/f(v)

2.- according to Misha,

dy/dx=1/(1-x-y)

but

dy/dx=d(-ln(1-x))/dx=1/(1-x)

yet

1/(1-x-y)=1/(1-x+ln(1-x)) or 1/(1-ln(|1-x|))

which obviously are not the same

Misha the 2nd reason why you shouldn't be using 1/u is that you may be losing poles while constraining the function domain to that of u=f(v), not the variable intended to be the domain.

For these reasons I consider my answer deserves to be the accepted answer.

John BG

Sign in to comment.

John BG
on 18 Dec 2016

Hi Basa

got you this

the upload does not accept Simulink file name extensions (!?) people compress and upload but it should be straight forward to upload MATLAB related files with MATLAB file name extensions, shouldn't it?

Well, if this answer helps you with this question, would you please be so kind to mark my answer as accepted?

thanks for attention, awaiting answer

Mischa Kim
on 18 Dec 2016

John BG
on 18 Dec 2016

Misha please have a look to my comments, the usage of 1/u to invert a derivative is completely erroneous as a I show above. You just found something that algebraically looked like it would work, you plugged it an got an erroneous Simulink circuit, that Basa took as good answer.

Please review you answer and correct accordingly.

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 3 Comments

## Direct link to this comment

https://de.mathworks.com/matlabcentral/answers/317328-how-can-we-model-this-equation-in-simulink-dx-dy-x-y-1-where-x-is-the-input-and-y-is-t#comment_414714

⋮## Direct link to this comment

https://de.mathworks.com/matlabcentral/answers/317328-how-can-we-model-this-equation-in-simulink-dx-dy-x-y-1-where-x-is-the-input-and-y-is-t#comment_414714

## Direct link to this comment

https://de.mathworks.com/matlabcentral/answers/317328-how-can-we-model-this-equation-in-simulink-dx-dy-x-y-1-where-x-is-the-input-and-y-is-t#comment_414740

⋮## Direct link to this comment

https://de.mathworks.com/matlabcentral/answers/317328-how-can-we-model-this-equation-in-simulink-dx-dy-x-y-1-where-x-is-the-input-and-y-is-t#comment_414740

## Direct link to this comment

https://de.mathworks.com/matlabcentral/answers/317328-how-can-we-model-this-equation-in-simulink-dx-dy-x-y-1-where-x-is-the-input-and-y-is-t#comment_414826

⋮## Direct link to this comment

https://de.mathworks.com/matlabcentral/answers/317328-how-can-we-model-this-equation-in-simulink-dx-dy-x-y-1-where-x-is-the-input-and-y-is-t#comment_414826

Sign in to comment.