How to solve equation in which output variable is dependent on input variable with iterations?

this is the equation i need to solve. I have all the constant values of Ts,Cv,b,Bo,Co,c,gamma. I also have the value of v (volume) with respect to time v(t). So i have to find the value of T but the formula also has T which means i need to iterate to find answers. Here the value of T changes with v so i need to iterate to find the T everytime v chnages. Since i find it difficult to create matlab code where i want T with accuracy of with 2 decimal point. can anybody help me with the code?

5 Comments

The ODE is not difficult to be typed out in MATLAB code. After all, the terms involve only elementary arithmetic operations and some exponentiation operations. If this involves the Ideal Gas Law, then there should be dynamical changes in not only the Temperature , but also the Pressure and the Volume :
There should be some governing laws for the Pressure and the Volume . Please check.
It is real gas equation of Benedict-Webb Rubin Equation. v is measured and i have the talbe for that with v(t). T(t) is to be changing with v(t). i have to perform iterations to get it i hope so. if u can provide me with some glance on how to perform iterations in this case. It would be helpful.
You don't need iteration.
You have a differential equation for T with v and vdot as time-dependent functions on the right-hand side.
Look at the example "ODE with Time-Dependent Terms" under
on how to solve such problems.
If you have only one ODE, , and the rest are constants and time-dependent measured data and , then it is still possible to solve the ODE using interp1 and ode45, as guided by @Torsten.

Sign in to comment.

Answers (0)

Products

Asked:

on 3 Apr 2022

Commented:

on 4 Apr 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!