I need an answer for the program below

10 ビュー (過去 30 日間)
M.Rameswari Sudha
M.Rameswari Sudha 2022 年 2 月 22 日
コメント済み: M.Rameswari Sudha 2025 年 1 月 24 日 6:28
I couldn't find the answer for t1. Here int means integral.
a1=30;
b1=5;
c1=5;
c2=10;
c3=12;
c4=8;
T=12;
syms t1
ft1=a1+b1.*t1;
D1='(ft1./T).*[c1.*(exp((al.*t1^2)./2)-1)+c2.*int((exp((al.*t1^2)./2)-1)).*dt+c3.*exp((del.*(t1-T))).*(t1-T)+c4.*exp((del.*(t1-T)))';
t1=solve'D1'
  2 件のコメント
Torsten
Torsten 2022 年 2 月 22 日
編集済み: Torsten 2022 年 2 月 22 日
Please show the equation you are trying to solve in a mathematical notation.
Your D1, especially the term int((exp((al.*t1^2)./2)-1)).*dt, does not make much sense.
Further, al, dt, del are undefined.
M.Rameswari Sudha
M.Rameswari Sudha 2022 年 2 月 23 日
I want to integrate this term int((exp((al.*t1^2)./2)-1)).*dt by using matlab, and then simultaneously I want to find t1 value from that equation. dt is a differential with respect to the variable t1 of integration. Here I want to change ft1 in different function of t1. so I didn't integrate the term int((exp((al.*t1^2)./2)-1)).*dt. sorry I forget to give the valu for al and del. al =0.01; del= 0.2; Kindly give the solution for the above equation.

サインインしてコメントする。

回答 (1 件)

Shishir Reddy
Shishir Reddy 2025 年 1 月 6 日
Hi Sudha
I see that you are trying to solve an equation involving an integral in MATLAB using symbolic variables. When MATLAB's solve function is unable to find an explicit solution, it often means that the equation is too complex for a straightforward analytical solution. This can happen with equations involving non-linear terms, such as exponentials and integrals.
Here are some steps you can take to address this issue:
1. Numerical Solutions: If an analytical solution is not possible, you can use numerical methods to find an approximate solution. MATLAB's vpasolve function can be used for this purpose.
2. Initial Guesses: Providing an initial guess can help numerical solvers converge to a solution.
syms t1
a1 = 30;
b1 = 5;
c1 = 5;
c2 = 10;
c3 = 12;
c4 = 8;
T = 12;
al = 0.01;
del = 0.2;
ft1 = a1 + b1 * t1;
integrated_term = int(exp((al * t1^2) / 2) - 1, t1);
D1 = (ft1 / T) * (c1 * (exp((al * t1^2) / 2) - 1) + ...
c2 * integrated_term + ...
c3 * exp((del * (t1 - T))) * (t1 - T) + ...
c4 * exp((del * (t1 - T))));
% Use vpasolve for a numerical solution
initial_guess = 0;
solution = vpasolve(D1 == 0, t1, initial_guess);
disp('Numerical solution for t1:')
Numerical solution for t1:
disp(solution)
For more information regarding vpasolve, kindly refer the following documentation -
I hope this resolves the issue
  1 件のコメント
M.Rameswari Sudha
M.Rameswari Sudha 2025 年 1 月 24 日 6:28
I accepted this answer

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by